2#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_LOGGERS_PROMETHEUS_PROMETHEUSMETRICBUILDERS_HPP_INCLUDED
3#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_LOGGERS_PROMETHEUS_PROMETHEUSMETRICBUILDERS_HPP_INCLUDED
18 const std::string& name,
19 const std::string& value) {
28 const std::string& name,
30 std::vector<PrometheusLabel> labels = {},
31 int64_t timestamp_ms = 0) {
35 s.labels = std::move(labels);
36 s.timestamp_ms = timestamp_ms;
42 const std::string& name,
43 const std::string& help,
55 const std::string& name,
56 const std::string& help,
58 std::vector<PrometheusLabel> labels) {
69 const std::string& name,
70 const std::string& help,
82 const std::string& name,
83 const std::string& help,
85 std::vector<PrometheusLabel> labels) {
96 const std::string& name,
97 const std::string& help,
109 const std::string& name,
110 const std::string& help,
112 std::vector<PrometheusLabel> labels) {
123 std::vector<PrometheusMetricFamily>& families,
124 const std::string& name,
125 const std::string& help,
127 std::vector<PrometheusLabel> labels = {}) {
133 std::vector<PrometheusMetricFamily>& families,
134 const std::string& name,
135 const std::string& help,
137 std::vector<PrometheusLabel> labels = {}) {
143 std::vector<PrometheusMetricFamily>& families,
144 const std::string& name,
145 const std::string& help,
147 std::vector<PrometheusLabel> labels = {}) {
Defines Prometheus text exposition format types and configuration.
The primary namespace for the LogIt++ library.
void add_prometheus_untyped(std::vector< PrometheusMetricFamily > &families, const std::string &name, const std::string &help, double value, std::vector< PrometheusLabel > labels={})
Append an Untyped metric family to the families vector (convenience for on_collect).
void add_prometheus_counter(std::vector< PrometheusMetricFamily > &families, const std::string &name, const std::string &help, double value, std::vector< PrometheusLabel > labels={})
Append a Counter metric family to the families vector (convenience for on_collect).
PrometheusLabel make_prometheus_label(const std::string &name, const std::string &value)
Create a single label pair.
void add_prometheus_gauge(std::vector< PrometheusMetricFamily > &families, const std::string &name, const std::string &help, double value, std::vector< PrometheusLabel > labels={})
Append a Gauge metric family to the families vector (convenience for on_collect).
PrometheusMetricFamily make_prometheus_gauge(const std::string &name, const std::string &help, double value)
Create a Gauge metric family with one unlabeled sample.
PrometheusMetricFamily make_prometheus_untyped(const std::string &name, const std::string &help, double value)
Create an Untyped metric family with one unlabeled sample.
PrometheusMetricFamily make_prometheus_counter(const std::string &name, const std::string &help, double value)
Create a Counter metric family with one unlabeled sample.
PrometheusSample make_prometheus_sample(const std::string &name, double value, std::vector< PrometheusLabel > labels={}, int64_t timestamp_ms=0)
Create a sample for a Prometheus metric family.
A single Prometheus label key-value pair.
std::string value
Label value.
std::string name
Label name.
A group of related samples sharing a name, help, and type.
std::vector< PrometheusSample > samples
Samples in this family.
std::string help
HELP text.
std::string name
Metric family name.
PrometheusMetricType type
Metric type.
A single metric sample with optional labels and timestamp.