Class representing a collection of Prometheus metric with the same name and type.
More...
#include <MetricsFamily.hpp>
Class representing a collection of Prometheus metric with the same name and type.
◆ MetricsFamily()
Construct a new MetricsFamily object.
- Parameters
-
name | The name of the metrics |
description | The description of the metrics |
type | The type of the metrics |
builder | The metric builder to use |
◆ getMetric() [1/2]
MetricBase & util::prometheus::MetricsFamily::getMetric |
( |
Labels | labels, |
|
|
std::vector< double > const & | buckets ) |
Get the metric with the given labels. If it does not exist, it will be created.
- Note
- This overload is only used for histograms with integer buckets
- Parameters
-
labels | The labels of the metric |
buckets | The buckets of the histogram. It is ignored for other metric types or if the metric already exists |
- Returns
- Reference to the metric
◆ getMetric() [2/2]
MetricBase & util::prometheus::MetricsFamily::getMetric |
( |
Labels | labels, |
|
|
std::vector< std::int64_t > const & | buckets = {} ) |
Get the metric with the given labels. If it does not exist, it will be created.
- Parameters
-
labels | The labels of the metric |
buckets | The buckets of the histogram. It is ignored for other metric types or if the metric already exists |
- Returns
- Reference to the metric
◆ name()
std::string const & util::prometheus::MetricsFamily::name |
( |
| ) |
const |
Get the name of the metrics.
- Returns
- The name
◆ type()
MetricType util::prometheus::MetricsFamily::type |
( |
| ) |
const |
Get the description of the metrics.
- Returns
- The description
◆ operator<<
Serialize the metrics to a string in Prometheus format as one block.
- Parameters
-
stream | The stream to serialize into |
metricsFamily | The metrics to serialize |
◆ defaultMetricBuilder
The default metric builder
The documentation for this class was generated from the following files:
- /__w/clio/clio/src/util/prometheus/MetricsFamily.hpp
- /__w/clio/clio/src/util/prometheus/MetricsFamily.cpp