Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
Data Structures | |
struct | prometheus_collector |
Prometheus collector definition. More... | |
struct | prometheus_counter |
Type used to represent a Prometheus counter metric. More... | |
struct | prometheus_gauge |
Type used to represent a Prometheus gauge metric. More... | |
struct | prometheus_histogram_bucket |
Prometheus histogram bucket definition. More... | |
struct | prometheus_histogram |
Type used to represent a Prometheus histogram metric. More... | |
struct | prometheus_label |
Prometheus label definition. More... | |
struct | prometheus_metric |
Type used to represent a Prometheus metric base. More... | |
struct | prometheus_summary_quantile |
Prometheus summary quantile definition. More... | |
struct | prometheus_summary |
Type used to represent a Prometheus summary metric. More... | |
Macros | |
#define | PROMETHEUS_COLLECTOR_DEFINE(_name) |
Prometheus Collector definition. | |
#define | PROMETHEUS_COUNTER_DEFINE(_name, _detail) |
Prometheus Counter definition. | |
#define | PROMETHEUS_GAUGE_DEFINE(_name, _detail) |
Prometheus Gauge definition. | |
#define | PROMETHEUS_HISTOGRAM_DEFINE(_name, _detail) |
Prometheus Histogram definition. | |
#define | MAX_PROMETHEUS_LABEL_KEY_LENGTH 16 |
#define | MAX_PROMETHEUS_LABEL_VALUE_LENGTH 16 |
#define | MAX_PROMETHEUS_LABELS_PER_METRIC 5 |
#define | MAX_METRIC_NAME_LENGTH 32 |
#define | MAX_METRIC_DESCRIPTION_LENGTH 64 |
#define | PROMETHEUS_SUMMARY_DEFINE(_name, _detail) |
Prometheus Summary definition. | |
Enumerations | |
enum | prometheus_metric_type { PROMETHEUS_COUNTER = 0 , PROMETHEUS_GAUGE , PROMETHEUS_SUMMARY , PROMETHEUS_HISTOGRAM } |
Prometheus metric types. More... | |
Functions | |
int | prometheus_collector_register_metric (struct prometheus_collector *collector, struct prometheus_metric *metric) |
Register a metric with a Prometheus collector. | |
const void * | prometheus_collector_get_metric (const struct prometheus_collector *collector, const char *name) |
Get a metric from a Prometheus collector. | |
int | prometheus_counter_inc (struct prometheus_counter *counter) |
Increment the value of a Prometheus counter metric Increments the value of the specified counter metric by one. | |
int | prometheus_format_exposition (const struct prometheus_collector *collector, char *buffer, size_t buffer_size) |
Format exposition data for Prometheus. | |
int | prometheus_gauge_set (struct prometheus_gauge *gauge, double value) |
Set the value of a Prometheus gauge metric. | |
int | prometheus_histogram_observe (struct prometheus_histogram *histogram, double value) |
Observe a value in a Prometheus histogram metric. | |
int | prometheus_summary_observe (struct prometheus_summary *summary, double value) |
Observes a value in a Prometheus summary metric. | |
#define MAX_METRIC_DESCRIPTION_LENGTH 64 |
#include <zephyr/net/prometheus/metric.h>
#define MAX_METRIC_NAME_LENGTH 32 |
#include <zephyr/net/prometheus/metric.h>
#define MAX_PROMETHEUS_LABEL_KEY_LENGTH 16 |
#include <zephyr/net/prometheus/label.h>
#define MAX_PROMETHEUS_LABEL_VALUE_LENGTH 16 |
#include <zephyr/net/prometheus/label.h>
#define MAX_PROMETHEUS_LABELS_PER_METRIC 5 |
#include <zephyr/net/prometheus/label.h>
#define PROMETHEUS_COLLECTOR_DEFINE | ( | _name | ) |
#include <zephyr/net/prometheus/collector.h>
Prometheus Collector definition.
This macro defines a Collector.
_name | The collector's name. |
#define PROMETHEUS_COUNTER_DEFINE | ( | _name, | |
_detail ) |
#include <zephyr/net/prometheus/counter.h>
Prometheus Counter definition.
This macro defines a Counter metric.
_name | The channel's name. |
_detail | The metric base. |
Example usage:
#define PROMETHEUS_GAUGE_DEFINE | ( | _name, | |
_detail ) |
#include <zephyr/net/prometheus/gauge.h>
Prometheus Gauge definition.
This macro defines a Gauge metric.
_name | The channel's name. |
_detail | The metric base. |
Example usage:
#define PROMETHEUS_HISTOGRAM_DEFINE | ( | _name, | |
_detail ) |
#include <zephyr/net/prometheus/histogram.h>
Prometheus Histogram definition.
This macro defines a Histogram metric.
_name | The channel's name. |
_detail | The metric base. |
Example usage:
#define PROMETHEUS_SUMMARY_DEFINE | ( | _name, | |
_detail ) |
#include <zephyr/net/prometheus/summary.h>
Prometheus Summary definition.
This macro defines a Summary metric.
_name | The channel's name. |
_detail | The metric base. |
Example usage:
#include <zephyr/net/prometheus/metric.h>
Prometheus metric types.
Enumerator | |
---|---|
PROMETHEUS_COUNTER | Prometheus Counter. |
PROMETHEUS_GAUGE | Prometheus Gauge. |
PROMETHEUS_SUMMARY | Prometheus Summary. |
PROMETHEUS_HISTOGRAM | Prometheus Histogram. |
const void * prometheus_collector_get_metric | ( | const struct prometheus_collector * | collector, |
const char * | name ) |
#include <zephyr/net/prometheus/collector.h>
Get a metric from a Prometheus collector.
Retrieves the metric with the specified name from the given collector.
collector | Pointer to the collector to retrieve the metric from. |
name | Name of the metric to retrieve. |
int prometheus_collector_register_metric | ( | struct prometheus_collector * | collector, |
struct prometheus_metric * | metric ) |
#include <zephyr/net/prometheus/collector.h>
Register a metric with a Prometheus collector.
Registers the specified metric with the given collector.
collector | Pointer to the collector to register the metric with. |
metric | Pointer to the metric to register. |
-EINVAL | Invalid arguments. |
-ENOMEM | Not enough memory to register the metric. |
int prometheus_counter_inc | ( | struct prometheus_counter * | counter | ) |
#include <zephyr/net/prometheus/counter.h>
Increment the value of a Prometheus counter metric Increments the value of the specified counter metric by one.
counter | Pointer to the counter metric to increment. |
int prometheus_format_exposition | ( | const struct prometheus_collector * | collector, |
char * | buffer, | ||
size_t | buffer_size ) |
#include <zephyr/net/prometheus/formatter.h>
Format exposition data for Prometheus.
Formats the exposition data collected by the specified collector into the provided buffer. Function to format metric data according to Prometheus text-based format
collector | Pointer to the collector containing the data to format. |
buffer | Pointer to the buffer where the formatted exposition data will be stored. |
buffer_size | Size of the buffer. |
int prometheus_gauge_set | ( | struct prometheus_gauge * | gauge, |
double | value ) |
#include <zephyr/net/prometheus/gauge.h>
Set the value of a Prometheus gauge metric.
Sets the value of the specified gauge metric to the given value.
gauge | Pointer to the gauge metric to set. |
value | Value to set the gauge metric to. |
int prometheus_histogram_observe | ( | struct prometheus_histogram * | histogram, |
double | value ) |
#include <zephyr/net/prometheus/histogram.h>
Observe a value in a Prometheus histogram metric.
Observes the specified value in the given histogram metric.
histogram | Pointer to the histogram metric to observe. |
value | Value to observe in the histogram metric. |
int prometheus_summary_observe | ( | struct prometheus_summary * | summary, |
double | value ) |
#include <zephyr/net/prometheus/summary.h>
Observes a value in a Prometheus summary metric.
Observes the specified value in the given summary metric.
summary | Pointer to the summary metric to observe. |
value | Value to observe in the summary metric. |