libprom
@VERSION@
C based libraries to expose metrics in Promtheus exposition format
|
Functions for retrieving metric samples from metrics given an ordered set of labels. More...
Go to the source code of this file.
Macros | |
#define | NaN (0.0f / 0.0f) |
Typedefs | |
typedef struct prom_metric | prom_metric_t |
A prometheus metric. More... | |
Functions | |
pms_t * | pms_from_labels (prom_metric_t *self, const char **label_values) |
Get a prom metric sample by label values. More... | |
pms_histogram_t * | pms_histogram_from_labels (prom_metric_t *self, const char **label_values) |
Get a prom histogram metric sample by label values. More... | |
Functions for retrieving metric samples from metrics given an ordered set of labels.
typedef struct prom_metric prom_metric_t |
A prometheus metric.
pms_t* pms_from_labels | ( | prom_metric_t * | self, |
const char ** | label_values | ||
) |
Get a prom metric sample by label values.
The order of label_values is significant.
You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case. Nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations.
self | Metric to use for lookup. |
label_values | label values associated with the metric sample being searched. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL . Otherwise, it may be convenient to pass this value as a literal. |
NULL
otherwise. pms_histogram_t* pms_histogram_from_labels | ( | prom_metric_t * | self, |
const char ** | label_values | ||
) |
Get a prom histogram metric sample by label values.
The order of label_values is significant.
You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case. Nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations.
self | Metric to use for lookup. |
label_values | label values associated with the metric sample being searched. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL . Otherwise, it may be convenient to pass this value as a literal. |
NULL
otherwise.