14 return std::make_unique<PrometheusRegistry>();
22 const std::string &name,
23 const std::string &help,
24 const std::map<std::string, std::string> &labels) {
25 registerFamily<Counter>(name, help, labels);
29 const std::string &name,
30 const std::string &help,
31 const std::map<std::string, std::string> &labels) {
32 registerFamily<Gauge>(name, help, labels);
36 const std::string &name,
37 const std::string &help,
38 const std::map<std::string, std::string> &labels) {
39 registerFamily<Histogram>(name, help, labels);
43 const std::string &name,
44 const std::string &help,
45 const std::map<std::string, std::string> &labels) {
46 registerFamily<Summary>(name, help, labels);
50 const std::string &name,
51 const std::map<std::string, std::string> &labels) {
52 return registerMetric<Counter>(name, labels);
56 const std::string &name,
57 const std::map<std::string, std::string> &labels) {
58 return registerMetric<Gauge>(name, labels);
62 const std::string &name,
63 const std::vector<double> &bucket_boundaries,
64 const std::map<std::string, std::string> &labels) {
65 return registerMetric<Histogram>(name, labels, bucket_boundaries);
69 const std::string &name,
70 const std::vector<std::pair<double, double>> &quantiles,
71 std::chrono::milliseconds max_age,
73 const std::map<std::string, std::string> &labels) {
74 prometheus::Summary::Quantiles q;
75 for (
const auto &p : quantiles) {
76 q.push_back({p.first, p.second});
78 return registerMetric<Summary>(name, labels, q, max_age, age_buckets);
an interface to add request handler for metrics::Exposer implementation generally will contain metric...
void registerSummaryFamily(const std::string &name, const std::string &help, const std::map< std::string, std::string > &labels) override
Summary * registerSummaryMetric(const std::string &name, const std::vector< std::pair< double, double >> &quantiles, std::chrono::milliseconds max_age, int age_buckets, const std::map< std::string, std::string > &labels) override
create summary metrics object
void setHandler(Handler &handler) override
A histogram metric to represent aggregatable distributions of events.
virtual void registerCollectable(Registry ®istry)=0
registers general type metrics registry for metrics collection
void registerHistogramFamily(const std::string &name, const std::string &help, const std::map< std::string, std::string > &labels) override
void registerGaugeFamily(const std::string &name, const std::string &help, const std::map< std::string, std::string > &labels) override
std::unique_ptr< Registry > RegistryPtr
RegistryPtr createRegistry()
A summary metric samples observations over a sliding window of time.
Histogram * registerHistogramMetric(const std::string &name, const std::vector< double > &bucket_boundaries, const std::map< std::string, std::string > &labels) override
create histogram metrics object
Counter * registerCounterMetric(const std::string &name, const std::map< std::string, std::string > &labels) override
create counter metrics object
void registerCounterFamily(const std::string &name, const std::string &help, const std::map< std::string, std::string > &labels) override
Gauge * registerGaugeMetric(const std::string &name, const std::map< std::string, std::string > &labels) override
create gauge metrics object
A gauge metric to represent a value that can arbitrarily go up and down.
A counter metric to represent a monotonically increasing value.