prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
Loading...
Searching...
No Matches
Classes | Namespaces
adapter.hpp File Reference

The backend boundary: MetricMeta, MetricState/MetricHandle, and the pure-virtual Adapter interface. More...

#include <prom/fwd.hpp>
#include <prom/labels.hpp>
#include <prom/unit.hpp>
#include <commons/display_info.hpp>
#include <cstdint>
#include <span>
#include <string_view>
Include dependency graph for adapter.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  prom::MetricMeta
 The complete, backend-agnostic description of a metric family handed to Adapter::register_metric. More...
 
class  prom::MetricState
 Opaque backend state for a registered family or a labeled child. More...
 
class  prom::Adapter
 The pluggable backend. More...
 
class  prom::AdapterSource
 The source a metric reads its current adapter from, decoupled from Registry so that metric_base can resolve a binding without depending on the registry layer (which would be an include cycle), mirroring ScopeState. More...
 

Namespaces

namespace  prom
 

Detailed Description

The backend boundary: MetricMeta, MetricState/MetricHandle, and the pure-virtual Adapter interface.

Everything below the metric types funnels through this one interface. A backend (the bundled NullAdapter, or e.g. the optional prometheus-cpp module) subclasses Adapter, and prom never lets a backend-specific type leak across this line. The model is register-then-mutate: a family is registered once, labeled children are obtained with resolve, and samples are pushed with inc/dec/set/observe.