|
prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
|
A backend that records nothing. More...
#include <null_adapter.hpp>


Public Member Functions | |
| NullAdapter () | |
| std::string_view | backend_name () const noexcept override |
Stable identifier of the backend (e.g. "null", "prometheus-cpp"). | |
| MetricHandle | register_metric (const MetricMeta &meta) noexcept override |
| Register a metric family. | |
| MetricHandle | resolve (const MetricHandle &, const Labels &dynamic) noexcept override |
Resolve the labeled child of family for the given dynamic labels, creating it on first request. | |
| void | inc (const MetricHandle &, const double amount) noexcept override |
Increase the series behind handle by amount (counter/gauge). | |
| void | dec (const MetricHandle &, const double amount) noexcept override |
Decrease the series behind handle by amount (gauge). | |
| void | set (const MetricHandle &, const double value) noexcept override |
Set the series behind handle to value (gauge/untyped). | |
| void | observe (const MetricHandle &, const double value) noexcept override |
Record an observation against handle (histogram/summary). | |
| void | set_info (const MetricHandle &, const std::span< const Label > labels) noexcept override |
| Replace the label set carried by an info metric. | |
| void | set_state (const MetricHandle &, std::string_view state, bool active) noexcept override |
| Set the boolean value of one member of a state set. | |
| void | set_unit (const MetricHandle &, const Unit &unit) noexcept override |
| Late unit inference hook. | |
Public Member Functions inherited from prom::Adapter | |
| Adapter ()=default | |
| Adapter (const Adapter &)=delete | |
| Adapter & | operator= (const Adapter &)=delete |
| Adapter (Adapter &&)=delete | |
| Adapter & | operator= (Adapter &&)=delete |
| virtual | ~Adapter ()=default |
A backend that records nothing.
Registration and resolution log at debug and hand back a single shared inert MetricState; mutations log at trace. Logging is null-guarded so construction before any logger setup is safe.
|
inline |
|
inlineoverridevirtualnoexcept |
Stable identifier of the backend (e.g. "null", "prometheus-cpp").
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Decrease the series behind handle by amount (gauge).
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Increase the series behind handle by amount (counter/gauge).
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Record an observation against handle (histogram/summary).
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Register a metric family.
Must return a non-null handle even on failure (fall back to an inert handle) so callers never have to null-check.
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Resolve the labeled child of family for the given dynamic labels, creating it on first request.
The backend owns the child cache. Must return a non-null handle.
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Set the series behind handle to value (gauge/untyped).
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Replace the label set carried by an info metric.
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Set the boolean value of one member of a state set.
Implements prom::Adapter.
|
inlineoverridevirtualnoexcept |
Late unit inference hook.
Called when a metric that declared no unit latches the unit of its first dimensional observation. Optional — backends that cannot rename a registered series may ignore it.
Reimplemented from prom::Adapter.