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

Label vocabulary: Label, the sorted/deduped Labels set, name validation, and an std::hash<Labels> specialization. More...

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <initializer_list>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
Include dependency graph for labels.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  prom::Label
 A single name="value" label pair. More...
 
class  prom::Labels
 An immutable-by-convention set of labels, kept sorted by name with duplicates collapsed last-wins. More...
 
struct  std::hash< prom::Labels >
 Hash a prom::Labels by its cached FNV-1a digest so it can key the labeled child caches that adapters maintain. More...
 

Namespaces

namespace  prom
 

Functions

constexpr bool prom::is_valid_metric_name (std::string_view name) noexcept
 A metric name is valid when it matches Prometheus's [a-zA-Z_][a-zA-Z0-9_]*.
 
constexpr bool prom::is_valid_label_name (const std::string_view name) noexcept
 A label name follows the metric-name charset but additionally rejects the __ prefix, which OpenMetrics reserves for internal use.
 

Detailed Description

Label vocabulary: Label, the sorted/deduped Labels set, name validation, and an std::hash<Labels> specialization.