Collector

This class provides methods to collect metrics with no label, one label, or multiple labels, using overloaded definitions of the collect method.

Once the desired stats have been collected, the accumulated response string can be collected using the getCollection method.

Additionally, the reset method can be used to reset stat collection, when the desired stats have been collected from a Collector instance.

Members

Functions

collect
void collect(ValuesT values)

Collect stats from the data members of a struct or a class and prepare them to be fetched upon the next call to getCollection. The specifications of the format of the collected stats can be found at https://prometheus.io/docs/instrumenting/exposition_formats/.

collect
void collect(ValuesT values, LabelT label_val)

Collect stats from the data members of a struct or a class, annotate them with a given label name and value, and prepare them to be fetched upon the next call to getCollection. The specifications of the format of the collected stats can be found at https://prometheus.io/docs/instrumenting/exposition_formats/.

collect
void collect(ValuesT values, LabelsT labels)

Collect stats from the data members of a struct or a class, annotate them with labels from the data members of another struct or class, and prepare them to be fetched upon the next call to getCollection. The specifications of the format of the collected stats can be found at https://prometheus.io/docs/instrumenting/exposition_formats/.

getCollection
cstring getCollection()
reset
void reset()

Reset the length of the stat collection buffer to 0.

Meta