8#ifndef ZEPHYR_INCLUDE_PROMETHEUS_HISTOGRAM_H_
9#define ZEPHYR_INCLUDE_PROMETHEUS_HISTOGRAM_H_
79#define PROMETHEUS_HISTOGRAM_DEFINE(_name, _desc, _label, _collector, ...) \
80 STRUCT_SECTION_ITERABLE(prometheus_histogram, _name) = { \
81 .base.name = STRINGIFY(_name), \
82 .base.type = PROMETHEUS_HISTOGRAM, \
83 .base.description = _desc, \
84 .base.labels[0] = __DEBRACKET _label, \
85 .base.num_labels = 1, \
86 .base.collector = _collector, \
91 .user_data = COND_CODE_0( \
92 NUM_VA_ARGS_LESS_1(LIST_DROP_EMPTY(__VA_ARGS__, _)), \
94 (GET_ARG_N(1, __VA_ARGS__))), \
int prometheus_histogram_observe(struct prometheus_histogram *histogram, double value)
Observe a value in a Prometheus histogram metric.
Prometheus metric interface.
Prometheus histogram bucket definition.
Definition histogram.h:30
unsigned long count
Cumulative count of observations in the bucket.
Definition histogram.h:34
double upper_bound
Upper bound value of bucket.
Definition histogram.h:32
Type used to represent a Prometheus histogram metric.
Definition histogram.h:43
size_t num_buckets
Number of buckets in the histogram.
Definition histogram.h:49
void * user_data
User data.
Definition histogram.h:55
struct prometheus_histogram_bucket * buckets
Array of buckets in the histogram.
Definition histogram.h:47
double sum
Sum of all observed values in the histogram.
Definition histogram.h:51
unsigned long count
Total count of observations in the histogram.
Definition histogram.h:53
struct prometheus_metric base
Base of the Prometheus histogram metric.
Definition histogram.h:45
Type used to represent a Prometheus metric base.
Definition metric.h:47