8#ifndef ZEPHYR_INCLUDE_PROMETHEUS_COUNTER_H_
9#define ZEPHYR_INCLUDE_PROMETHEUS_COUNTER_H_
60#define PROMETHEUS_COUNTER_DEFINE(_name, _desc, _label, _collector, ...) \
61 STRUCT_SECTION_ITERABLE(prometheus_counter, _name) = { \
62 .base.name = STRINGIFY(_name), \
63 .base.type = PROMETHEUS_COUNTER, \
64 .base.description = _desc, \
65 .base.labels[0] = __DEBRACKET _label, \
66 .base.num_labels = 1, \
67 .base.collector = _collector, \
69 .user_data = COND_CODE_0( \
70 NUM_VA_ARGS_LESS_1(LIST_DROP_EMPTY(__VA_ARGS__, _)), \
72 (GET_ARG_N(1, __VA_ARGS__))), \
int prometheus_counter_set(struct prometheus_counter *counter, uint64_t value)
Set the counter value to specific value.
int prometheus_counter_add(struct prometheus_counter *counter, uint64_t value)
Increment the value of a Prometheus counter metric Increments the value of the specified counter metr...
static int prometheus_counter_inc(struct prometheus_counter *counter)
Increment the value of a Prometheus counter metric Increments the value of the specified counter metr...
Definition counter.h:90
Prometheus metric interface.
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Type used to represent a Prometheus counter metric.
Definition counter.h:31
uint64_t value
Value of the Prometheus counter metric.
Definition counter.h:35
void * user_data
User data.
Definition counter.h:37
struct prometheus_metric base
Base of the Prometheus counter metric.
Definition counter.h:33
Type used to represent a Prometheus metric base.
Definition metric.h:47