8#include "prometheus/collectable.h"
9#include "prometheus/detail/core_export.h"
10#include "prometheus/family.h"
11#include "prometheus/labels.h"
12#include "prometheus/metric_family.h"
58 explicit Registry(InsertBehavior insert_behavior = InsertBehavior::Merge);
81 std::vector<MetricFamily> Collect()
const override;
98 friend class detail::Builder;
100 template <
typename T>
101 std::vector<std::unique_ptr<Family<T>>>& GetFamilies();
103 template <
typename T>
104 bool NameExistsInOtherType(
const std::string& name)
const;
106 template <
typename T>
107 Family<T>& Add(
const std::string& name,
const std::string& help,
108 const Labels& labels);
111 std::vector<std::unique_ptr<Family<Counter>>> counters_;
112 std::vector<std::unique_ptr<Family<Gauge>>> gauges_;
113 std::vector<std::unique_ptr<Family<Histogram>>> histograms_;
114 std::vector<std::unique_ptr<Family<Summary>>> summaries_;
115 mutable std::mutex mutex_;
Interface implemented by anything that can be used by Prometheus to collect metrics.
Definition collectable.h:17
A metric of type T with a set of labeled dimensions.
Definition family.h:61
Manages the collection of a number of metrics.
Definition registry.h:40
Registry & operator=(Registry &&)=delete
Deleted move assignment.
~Registry() override
name Destroys a registry.
Registry(const Registry &)=delete
Deleted copy constructor.
Registry(Registry &&)=delete
Deleted move constructor.
Registry & operator=(const Registry &)=delete
Deleted copy assignment.
InsertBehavior
How to deal with repeatedly added family names for a type.
Definition registry.h:46