Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
metric.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_NET_PROMETHEUS_METRIC_H_
9
#define ZEPHYR_INCLUDE_NET_PROMETHEUS_METRIC_H_
10
19
20
#include <
zephyr/sys/iterable_sections.h
>
21
#include <
zephyr/sys/slist.h
>
22
#include <
zephyr/net/prometheus/label.h
>
23
30
enum
prometheus_metric_type
{
32
PROMETHEUS_COUNTER
= 0,
34
PROMETHEUS_GAUGE
,
36
PROMETHEUS_SUMMARY
,
38
PROMETHEUS_HISTOGRAM
,
39
};
40
47
struct
prometheus_metric
{
49
sys_snode_t
node
;
51
struct
prometheus_collector
*
collector
;
56
void
*
metric
;
58
enum
prometheus_metric_type
type
;
60
const
char
*
name
;
62
const
char
*
description
;
64
struct
prometheus_label
labels
[
MAX_PROMETHEUS_LABELS_PER_METRIC
];
66
int
num_labels
;
68
void
*
user_data
;
69
/* Add any other necessary fields */
70
};
71
75
76
#endif
/* ZEPHYR_INCLUDE_NET_PROMETHEUS_METRIC_H_ */
prometheus_metric_type
prometheus_metric_type
Prometheus metric types.
Definition
metric.h:30
MAX_PROMETHEUS_LABELS_PER_METRIC
#define MAX_PROMETHEUS_LABELS_PER_METRIC
Definition
label.h:23
PROMETHEUS_HISTOGRAM
@ PROMETHEUS_HISTOGRAM
Prometheus Histogram.
Definition
metric.h:38
PROMETHEUS_GAUGE
@ PROMETHEUS_GAUGE
Prometheus Gauge.
Definition
metric.h:34
PROMETHEUS_SUMMARY
@ PROMETHEUS_SUMMARY
Prometheus Summary.
Definition
metric.h:36
PROMETHEUS_COUNTER
@ PROMETHEUS_COUNTER
Prometheus Counter.
Definition
metric.h:32
sys_snode_t
struct _snode sys_snode_t
Single-linked list node structure.
Definition
slist.h:42
label.h
Prometheus label interface.
slist.h
Header file for the single-linked list API.
prometheus_collector
Prometheus collector definition.
Definition
collector.h:50
prometheus_label
Prometheus label definition.
Definition
label.h:31
prometheus_metric
Type used to represent a Prometheus metric base.
Definition
metric.h:47
prometheus_metric::type
enum prometheus_metric_type type
Type of the Prometheus metric.
Definition
metric.h:58
prometheus_metric::collector
struct prometheus_collector * collector
Back pointer to the collector that this metric belongs to.
Definition
metric.h:51
prometheus_metric::num_labels
int num_labels
Number of labels associated with the Prometheus metric.
Definition
metric.h:66
prometheus_metric::name
const char * name
Name of the Prometheus metric.
Definition
metric.h:60
prometheus_metric::metric
void * metric
Back pointer to the actual metric (counter, gauge, etc.).
Definition
metric.h:56
prometheus_metric::node
sys_snode_t node
Slist metric list node.
Definition
metric.h:49
prometheus_metric::description
const char * description
Description of the Prometheus metric.
Definition
metric.h:62
prometheus_metric::user_data
void * user_data
User defined data.
Definition
metric.h:68
prometheus_metric::labels
struct prometheus_label labels[MAX_PROMETHEUS_LABELS_PER_METRIC]
Labels associated with the Prometheus metric.
Definition
metric.h:64
iterable_sections.h
Iterable sections helpers.
zephyr
net
prometheus
metric.h
Generated on
for Zephyr API by
1.17.0