prometheus-client-c
0.1.1
Prometheus client for the C programming language
|
Functions for retrieving metric samples from metrics given an ordered set of labels. More...
Go to the source code of this file.
Typedefs | |
typedef struct prom_metric | prom_metric_t |
A prometheus metric. More... | |
Functions | |
prom_metric_sample_t * | prom_metric_sample_from_labels (prom_metric_t *self, const char **label_values) |
Returns a prom_metric_sample_t*. More... | |
prom_metric_sample_histogram_t * | prom_metric_sample_histogram_from_labels (prom_metric_t *self, const char **label_values) |
Returns a prom_metric_sample_histogram_t*. More... | |
Functions for retrieving metric samples from metrics given an ordered set of labels.
typedef struct prom_metric prom_metric_t |
A prometheus metric.
prom_metric_sample_t* prom_metric_sample_from_labels | ( | prom_metric_t * | self, |
const char ** | label_values | ||
) |
Returns a prom_metric_sample_t*.
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 | The target prom_metric_t* |
label_values | The label values associated with the metric sample being updated. 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. |
prom_metric_sample_histogram_t* prom_metric_sample_histogram_from_labels | ( | prom_metric_t * | self, |
const char ** | label_values | ||
) |
Returns a prom_metric_sample_histogram_t*.
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 | The target prom_histogram_metric_t* |
label_values | The label values associated with the metric sample being updated. 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. |