prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
Loading...
Searching...
No Matches
Public Member Functions | List of all members
prom::Info Class Reference

An info metric: a single sample whose labels carry the payload (build version, commit, ...). More...

#include <info.hpp>

Inheritance diagram for prom::Info:
Inheritance graph
[legend]
Collaboration diagram for prom::Info:
Collaboration graph
[legend]

Public Member Functions

 Info (const std::string_view name, const std::string_view help)
 
 Info (const InfoSpec &spec)
 
 Info (std::shared_ptr< MetricCore > core)
 
void set (const std::initializer_list< Label > labels) const noexcept
 Set the info label payload from a braced list.
 
void set (const Labels &labels) const noexcept
 Set the info label payload from a Labels set.
 
Info labels (const Labels &dynamic) const noexcept
 
- Public Member Functions inherited from prom::MetricBase< Info >
std::string_view name () const noexcept
 The metric's fully-qualified name.
 
MetricType type () const noexcept
 The metric kind.
 

Additional Inherited Members

- Protected Member Functions inherited from prom::MetricBase< Info >
 MetricBase (const MetricType type, const std::string_view name, const std::string_view help)
 Standalone, unbound construction from a name and help string.
 
 MetricBase (std::shared_ptr< MetricCore > core)
 Adopt an already-populated core (registered metrics and children).
 
 MetricBase (const MetricBase &)=default
 
 MetricBase (MetricBase &&)=default
 
MetricBaseoperator= (const MetricBase &)=default
 
MetricBaseoperator= (MetricBase &&)=default
 
 ~MetricBase ()=default
 
Binding bind () const noexcept
 Resolve the adapter and backend handle this metric should record against.
 
const std::shared_ptr< MetricCore > & core () const noexcept
 
Info make_child (const Labels &dynamic) const noexcept
 Resolve a labeled child of the same metric type.
 
bool reconcile_unit (const Unit &observed, Adapter &adapter) const noexcept
 Reconcile an observed unit against the family's known unit.
 
bool check_finite (const double value, std::string_view op) const noexcept
 Drop-and-log guard for a non-finite sample.
 
- Static Protected Member Functions inherited from prom::MetricBase< Info >
static spdlog::logger * logger () noexcept
 The shared per-process metrics logger.
 
- Protected Attributes inherited from prom::MetricBase< Info >
std::shared_ptr< MetricCorecore_
 

Detailed Description

An info metric: a single sample whose labels carry the payload (build version, commit, ...).

Backends typically render it as name_info{...} 1.

Constructor & Destructor Documentation

◆ Info() [1/3]

prom::Info::Info ( const std::string_view  name,
const std::string_view  help 
)
inline

◆ Info() [2/3]

prom::Info::Info ( const InfoSpec spec)
inlineexplicit

◆ Info() [3/3]

prom::Info::Info ( std::shared_ptr< MetricCore core)
inlineexplicit

Member Function Documentation

◆ labels()

Info prom::Info::labels ( const Labels dynamic) const
inlinenoexcept

◆ set() [1/2]

void prom::Info::set ( const Labels labels) const
inlinenoexcept

Set the info label payload from a Labels set.

◆ set() [2/2]

void prom::Info::set ( const std::initializer_list< Label labels) const
inlinenoexcept

Set the info label payload from a braced list.


The documentation for this class was generated from the following file: