|
prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
|
The process-wide adapter cell and its install/swap semantics. More...
#include <prom/adapter.hpp>#include <prom/null_adapter.hpp>#include <atomic>#include <cstdint>#include <memory>#include <mutex>#include <utility>

Go to the source code of this file.
Classes | |
| class | prom::AdapterCell |
| A swappable adapter slot shared by every metric that reads from it. More... | |
Namespaces | |
| namespace | prom |
| namespace | prom::detail |
Portable atomic shared_ptr<const T> exposing just load()/store(). | |
The process-wide adapter cell and its install/swap semantics.
The adapter no longer lives on each metric — it lives on an AdapterCell (an AdapterSource) that metrics read through. Standalone and scoped metrics share the process-wide cell returned by detail::global_adapter_cell(); a Registry owns its own cell. Install the real backend on a cell and every metric reading from it migrates to the new backend on its next use:
The default adapter is a NullAdapter, so metrics are always safe to use before any backend is installed.