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

PrometheusCppAdapter — a fully-functional prom backend built on jupp0r/prometheus-cpp. More...

#include <prom/adapter.hpp>
#include <memory>
#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

class  prom::prometheus_cpp::PrometheusCppAdapter
 Maps prom's metric types onto prometheus-cpp families and series. More...
 

Namespaces

namespace  prometheus
 
namespace  prom
 
namespace  prom::prometheus_cpp
 

Detailed Description

PrometheusCppAdapter — a fully-functional prom backend built on jupp0r/prometheus-cpp.

This is the header a host application includes to install a real backend:

auto adapter = std::make_shared<prom::prometheus_cpp::PrometheusCppAdapter>();
prom::Registry::global()->set_adapter(adapter);
// ... expose adapter->registry() through an HTTP scrape endpoint ...
static std::shared_ptr< Registry > global()
The process-wide registry, sharing the global adapter cell and the global decoration.
Definition registry.hpp:147

The prometheus-cpp headers never appear here — they live entirely inside src/adapter.cpp behind a pimpl, so prom's core stays free of them.