Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gauge.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Mustafa Abdullah Kus, Sparse Technology
3 * Copyright (c) 2024 Nordic Semiconductor
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_INCLUDE_PROMETHEUS_GAUGE_H_
9#define ZEPHYR_INCLUDE_PROMETHEUS_GAUGE_H_
10
22
33 double value;
35 void *user_data;
36};
37
59#define PROMETHEUS_GAUGE_DEFINE(_name, _desc, _label, _collector, ...) \
60 STRUCT_SECTION_ITERABLE(prometheus_gauge, _name) = { \
61 .base.name = STRINGIFY(_name), \
62 .base.type = PROMETHEUS_GAUGE, \
63 .base.description = _desc, \
64 .base.labels[0] = __DEBRACKET _label, \
65 .base.num_labels = 1, \
66 .base.collector = _collector, \
67 .value = 0.0, \
68 .user_data = COND_CODE_0( \
69 NUM_VA_ARGS_LESS_1(LIST_DROP_EMPTY(__VA_ARGS__, _)), \
70 (NULL), \
71 (GET_ARG_N(1, __VA_ARGS__))), \
72 }
73
84int prometheus_gauge_set(struct prometheus_gauge *gauge, double value);
85
90#endif /* ZEPHYR_INCLUDE_PROMETHEUS_GAUGE_H_ */
int prometheus_gauge_set(struct prometheus_gauge *gauge, double value)
Set the value of a Prometheus gauge metric.
Prometheus metric interface.
Type used to represent a Prometheus gauge metric.
Definition gauge.h:29
void * user_data
User data.
Definition gauge.h:35
struct prometheus_metric base
Base of the Prometheus gauge metric.
Definition gauge.h:31
double value
Value of the Prometheus gauge metric.
Definition gauge.h:33
Type used to represent a Prometheus metric base.
Definition metric.h:47