Line data Source code
1 1 : /*
2 : * Copyright (c) 2024 Mustafa Abdullah Kus, Sparse Technology
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_INCLUDE_PROMETHEUS_LABEL_H_
8 : #define ZEPHYR_INCLUDE_PROMETHEUS_LABEL_H_
9 :
10 : /**
11 : * @file
12 : *
13 : * @brief Prometheus label interface.
14 : *
15 : * @addtogroup prometheus
16 : * @{
17 : */
18 :
19 : #if defined(CONFIG_PROMETHEUS)
20 : /** Maximum number of labels per metric */
21 : #define MAX_PROMETHEUS_LABELS_PER_METRIC CONFIG_PROMETHEUS_LABEL_MAX_COUNT
22 : #else
23 0 : #define MAX_PROMETHEUS_LABELS_PER_METRIC 1
24 : #endif /* CONFIG_PROMETHEUS */
25 :
26 : /**
27 : * @brief Prometheus label definition.
28 : *
29 : * This structure defines a Prometheus label.
30 : */
31 1 : struct prometheus_label {
32 : /** Prometheus metric label key */
33 1 : const char *key;
34 : /** Prometheus metric label value */
35 1 : const char *value;
36 : };
37 :
38 : /**
39 : * @}
40 : */
41 :
42 : #endif /* ZEPHYR_INCLUDE_PROMETHEUS_LABEL_H_ */
|