8#ifndef ZEPHYR_INCLUDE_PROMETHEUS_SUMMARY_H_
9#define ZEPHYR_INCLUDE_PROMETHEUS_SUMMARY_H_
83#define PROMETHEUS_SUMMARY_DEFINE(_name, _desc, _label, _collector, ...) \
84 STRUCT_SECTION_ITERABLE(prometheus_summary, _name) = { \
85 .base.name = STRINGIFY(_name), \
86 .base.type = PROMETHEUS_SUMMARY, \
87 .base.description = _desc, \
88 .base.labels[0] = __DEBRACKET _label, \
89 .base.num_labels = 1, \
90 .base.collector = _collector, \
95 .user_data = COND_CODE_0( \
96 NUM_VA_ARGS_LESS_1(LIST_DROP_EMPTY(__VA_ARGS__, _)), \
98 (GET_ARG_N(1, __VA_ARGS__))), \
124 double value,
unsigned long count);
int prometheus_summary_observe(struct prometheus_summary *summary, double value)
Observes a value in a Prometheus summary metric.
int prometheus_summary_observe_set(struct prometheus_summary *summary, double value, unsigned long count)
Set the summary value to specific value.
Prometheus metric interface.
Type used to represent a Prometheus metric base.
Definition metric.h:47
Prometheus summary quantile definition.
Definition summary.h:30
double value
Value of the quantile.
Definition summary.h:34
void * user_data
User data.
Definition summary.h:36
double quantile
Quantile of the summary.
Definition summary.h:32
Type used to represent a Prometheus summary metric.
Definition summary.h:45
struct prometheus_summary_quantile * quantiles
Array of quantiles associated with the Prometheus summary metric.
Definition summary.h:49
unsigned long count
Total count of observations in the summary metric.
Definition summary.h:55
size_t num_quantiles
Number of quantiles associated with the Prometheus summary metric.
Definition summary.h:51
struct prometheus_metric base
Base of the Prometheus summary metric.
Definition summary.h:47
void * user_data
User data.
Definition summary.h:57
double sum
Sum of all observed values in the summary metric.
Definition summary.h:53