8#include <initializer_list>
27 Info(
const std::string_view
name,
const std::string_view help)
40 void set(
const std::initializer_list<Label>
labels)
const noexcept {
41 const std::vector<Label> owned(
labels);
47 const auto [adapter, handle] = this->
bind();
48 adapter->set_info(handle,
labels.view());
56 void emit(
const std::vector<Label>&
labels)
const noexcept {
57 const auto [adapter, handle] = this->
bind();
58 adapter->set_info(handle, std::span<const Label>(
labels));
An info metric: a single sample whose labels carry the payload (build version, commit,...
Definition info.hpp:25
Info(std::shared_ptr< MetricCore > core)
Definition info.hpp:37
Info(const InfoSpec &spec)
Definition info.hpp:30
Info labels(const Labels &dynamic) const noexcept
Definition info.hpp:51
Info(const std::string_view name, const std::string_view help)
Definition info.hpp:27
void set(const Labels &labels) const noexcept
Set the info label payload from a Labels set.
Definition info.hpp:46
void set(const std::initializer_list< Label > labels) const noexcept
Set the info label payload from a braced list.
Definition info.hpp:40
An immutable-by-convention set of labels, kept sorted by name with duplicates collapsed last-wins.
Definition labels.hpp:55
CRTP base shared by every metric type.
Definition metric_base.hpp:377
Info make_child(const Labels &dynamic) const noexcept
Resolve a labeled child of the same metric type.
Definition metric_base.hpp:458
std::string_view name() const noexcept
The metric's fully-qualified name.
Definition metric_base.hpp:380
const std::shared_ptr< MetricCore > & core() const noexcept
Definition metric_base.hpp:449
std::shared_ptr< MetricCore > core_
Definition metric_base.hpp:530
Binding bind() const noexcept
Resolve the adapter and backend handle this metric should record against.
Definition metric_base.hpp:435
MetricCore (the shared per-series state) and the CRTP MetricBase that gives every metric type value s...
Definition adapter.hpp:24
MetricType
The OpenMetrics / Prometheus metric kinds prom understands.
Definition unit.hpp:15
Declarative description of an info metric.
Definition info.hpp:16
comms::DisplayInfo display
Definition info.hpp:20
std::string_view help
Definition info.hpp:18
Labels labels
Constant labels carried alongside the info set.
Definition info.hpp:19
std::string_view name
Definition info.hpp:17