Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
collector.h
Go to the documentation of this file.
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_COLLECTOR_H_
8#define ZEPHYR_INCLUDE_PROMETHEUS_COLLECTOR_H_
9
24
25#include <stddef.h>
26
34 const char *name;
36 struct prometheus_metric *metric[CONFIG_PROMETHEUS_MAX_METRICS];
38 size_t size;
39};
40
48#define PROMETHEUS_COLLECTOR_DEFINE(_name) \
49 static STRUCT_SECTION_ITERABLE(prometheus_collector, _name) = { \
50 .name = STRINGIFY(_name), .size = 0, .metric = {0}}
51
65 struct prometheus_metric *metric);
66
76const void *prometheus_collector_get_metric(const struct prometheus_collector *collector,
77 const char *name);
78
83#endif /* ZEPHYR_INCLUDE_PROMETHEUS_COLLECTOR_H_ */
const void * prometheus_collector_get_metric(const struct prometheus_collector *collector, const char *name)
Get a metric from a Prometheus collector.
int prometheus_collector_register_metric(struct prometheus_collector *collector, struct prometheus_metric *metric)
Register a metric with a Prometheus collector.
Prometheus metric interface.
Prometheus collector definition.
Definition collector.h:32
const char * name
Name of the collector.
Definition collector.h:34
size_t size
Number of metrics associated with the collector.
Definition collector.h:38
struct prometheus_metric * metric[CONFIG_PROMETHEUS_MAX_METRICS]
Array of metrics associated with the collector.
Definition collector.h:36
Type used to represent a Prometheus metric base.
Definition metric.h:48
char name[32]
Name of the Prometheus metric.
Definition metric.h:52