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"
59 explicit Registry(InsertBehavior insert_behavior = InsertBehavior::Merge);
82 std::vector<MetricFamily> Collect()
const override;
99 friend class detail::Builder;
101 template <
typename T>
102 std::vector<std::unique_ptr<Family<T>>>& GetFamilies();
104 template <
typename T>
105 bool NameExistsInOtherType(
const std::string& name)
const;
107 template <
typename T>
108 Family<T>& Add(
const std::string& name,
const std::string& help,
109 const Labels& labels);
112 std::vector<std::unique_ptr<Family<Counter>>> counters_;
113 std::vector<std::unique_ptr<Family<Gauge>>> gauges_;
114 std::vector<std::unique_ptr<Family<Histogram>>> histograms_;
115 std::vector<std::unique_ptr<Family<Info>>> infos_;
116 std::vector<std::unique_ptr<Family<Summary>>> summaries_;
117 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:62
Manages the collection of a number of metrics.
Definition registry.h:41
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:47