Manages the collection of a number of metrics.
The Registry is responsible to expose data to a class/method/function "bridge", which returns the metrics in a format Prometheus supports.
The key class is the Collectable. This has a method - called Collect() - that returns zero or more metrics and their samples. The metrics are represented by the class Family<>, which implements the Collectable interface. A new metric is registered with BuildCounter(), BuildGauge(), BuildHistogram(), BuildInfo() or BuildSummary().
The class is thread-safe. No concurrent call to any API of this type causes a data race.
Definition at line 41 of file sources/includes/prometheus/registry.h.


Public Types | |
| enum | InsertBehavior { InsertBehavior::Merge, InsertBehavior::Throw, InsertBehavior::Merge, InsertBehavior::Throw } |
| How to deal with repeatedly added family names for a type. More... | |
| enum | InsertBehavior { InsertBehavior::Merge, InsertBehavior::Throw, InsertBehavior::Merge, InsertBehavior::Throw } |
| How to deal with repeatedly added family names for a type. More... | |
Public Member Functions | |
| Registry (InsertBehavior insert_behavior=InsertBehavior::Merge) | |
| name Create a new registry. More... | |
| Registry (const Registry &)=delete | |
| Deleted copy constructor. More... | |
| Registry & | operator= (const Registry &)=delete |
| Deleted copy assignment. More... | |
| Registry (Registry &&)=delete | |
| Deleted move constructor. More... | |
| Registry & | operator= (Registry &&)=delete |
| Deleted move assignment. More... | |
| ~Registry () override | |
| name Destroys a registry. More... | |
| std::vector< MetricFamily > | Collect () const override |
| Returns a list of metrics and their samples. More... | |
| template<typename T > | |
| bool | Remove (const Family< T > &family) |
| Removes a metrics family from the registry. More... | |
| Registry (InsertBehavior insert_behavior=InsertBehavior::Merge) | |
| name Create a new registry. More... | |
| Registry (const Registry &)=delete | |
| Deleted copy constructor. More... | |
| Registry & | operator= (const Registry &)=delete |
| Deleted copy assignment. More... | |
| Registry (Registry &&)=delete | |
| Deleted move constructor. More... | |
| Registry & | operator= (Registry &&)=delete |
| Deleted move assignment. More... | |
| ~Registry () override | |
| name Destroys a registry. More... | |
| std::vector< MetricFamily > | Collect () const override |
| Returns a list of metrics and their samples. More... | |
| template<typename T > | |
| bool | Remove (const Family< T > &family) |
| Removes a metrics family from the registry. More... | |
Friends | |
| template<typename T > | |
| class | detail::Builder |
| template<typename T > | |
| class | detail::Builder |
|
strong |
How to deal with repeatedly added family names for a type.
Adding a family with the same name but different types is always an error and will lead to an exception.
Definition at line 47 of file sources/includes/prometheus/registry.h.
|
strong |
How to deal with repeatedly added family names for a type.
Adding a family with the same name but different types is always an error and will lead to an exception.
Definition at line 47 of file 9.0/sources/includes/prometheus/registry.h.
|
explicit |
name Create a new registry.
| insert_behavior | How to handle families with the same name. |
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
|
override |
name Destroys a registry.
|
explicit |
name Create a new registry.
| insert_behavior | How to handle families with the same name. |
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
|
override |
name Destroys a registry.
|
overridevirtual |
Returns a list of metrics and their samples.
Every time the Registry is scraped it calls each of the metrics Collect function.
Implements prometheus::Collectable.
|
overridevirtual |
Returns a list of metrics and their samples.
Every time the Registry is scraped it calls each of the metrics Collect function.
Implements prometheus::Collectable.
| bool prometheus::Registry::Remove | ( | const Family< T > & | family | ) |
Removes a metrics family from the registry.
Please note that this operation invalidates the previously returned reference to the Family and all of their added metric objects.
| family | The family to remove |
| bool prometheus::Registry::Remove | ( | const Family< T > & | family | ) |
Removes a metrics family from the registry.
Please note that this operation invalidates the previously returned reference to the Family and all of their added metric objects.
| family | The family to remove |
|
friend |
Definition at line 99 of file sources/includes/prometheus/registry.h.
|
friend |
Definition at line 99 of file 9.0/sources/includes/prometheus/registry.h.