|
prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
|
Registry — the front door for creating registered metrics.
More...
#include <prom/adapter.hpp>#include <prom/counter.hpp>#include <prom/error.hpp>#include <prom/gauge.hpp>#include <prom/global.hpp>#include <prom/histogram.hpp>#include <prom/info.hpp>#include <prom/labels.hpp>#include <prom/metric_base.hpp>#include <prom/stateset.hpp>#include <prom/summary.hpp>#include <prom/unit.hpp>#include <prom/untyped.hpp>#include <cmath>#include <cstddef>#include <memory>#include <mutex>#include <optional>#include <string>#include <string_view>#include <utility>#include <vector>

Go to the source code of this file.
Classes | |
| struct | prom::RegistryConfig |
The decoration a Registry applies to every metric created through it: a name prefix, default constant labels, and default display metadata. More... | |
| struct | prom::MetricInfo |
A read-only snapshot describing one registered metric, returned by the enumeration APIs (Registry::metrics, Scope::metrics). More... | |
| class | prom::Registry |
| Creates registered metrics against a single adapter cell. More... | |
Namespaces | |
| namespace | prom |
Registry — the front door for creating registered metrics.
A Registry owns an AdapterCell: the adapter lives on the registry, not on the metrics it creates, so swapping the registry's adapter reconfigures every metric created from it (each re-registers against the new backend on its next use). Each factory validates its spec, builds a stable MetricCore pointing at the registry's cell, eagerly registers the family, tracks it for enumeration, and returns a typed metric. The throwing factories (counter, ...) raise prom::Exception; the try_* mirrors are noexcept and return prom::expected.
Registry is non-copyable and shared_ptr-managed: obtain one with Registry::create(adapter) or the process-wide Registry::global(), and use it through ->.
The *Spec structs live with their metric types (<prom/counter.hpp> …) and are all visible through this header.