#pragma once #include #include #include #include #include #include #include #include #include #include "prometheus/collectable.h" #include "prometheus/metric.h" #include "prometheus/hash.h" namespace prometheus { /// \brief A metric of type T with a set of labeled dimensions. /// /// One of Prometheus main feature is a multi-dimensional data model with time /// series data identified by metric name and key/value pairs, also known as /// labels. A time series is a series of data points indexed (or listed or /// graphed) in time order (https://en.wikipedia.org/wiki/Time_series). /// /// An instance of this class is exposed as multiple time series during /// scrape, i.e., one time series for each set of labels provided to Add(). /// /// For example it is possible to collect data for a metric /// `http_requests_total`, with two time series: /// /// - all HTTP requests that used the method POST /// - all HTTP requests that used the method GET /// /// The metric name specifies the general feature of a system that is /// measured, e.g., `http_requests_total`. Labels enable Prometheus's /// dimensional data model: any given combination of labels for the same /// metric name identifies a particular dimensional instantiation of that /// metric. For example a label for 'all HTTP requests that used the method /// POST' can be assigned with `method= "POST"`. /// /// Given a metric name and a set of labels, time series are frequently /// identified using this notation: /// /// { < label name >=