Tracks log-record counters and builds built-in Prometheus metric families.
More...
#include <PrometheusLoggerMetrics.hpp>
|
| static int64_t | counter_to_int64 (uint64_t value) |
| | Safely convert uint64_t counter to int64_t (clamping on overflow).
|
| |
Tracks log-record counters and builds built-in Prometheus metric families.
Definition at line 20 of file PrometheusLoggerMetrics.hpp.
◆ add_common_labels()
◆ add_dropped()
| void logit::PrometheusLoggerMetrics::add_dropped |
( |
uint64_t | count = 1 | ) |
|
|
inline |
◆ add_failed_export()
| void logit::PrometheusLoggerMetrics::add_failed_export |
( |
uint64_t | count = 1 | ) |
|
|
inline |
◆ build_builtin_metrics()
Append the six built-in metric families to families.
- Parameters
-
| families | Destination vector. |
| config | Format configuration (prefix, labels, build-info flag). |
| logger_name | Value for the logger label (e.g. "prometheus_payload"). |
| now_ms | Current wall time in milliseconds (from LOGIT_CURRENT_TIMESTAMP_MS()). |
Definition at line 73 of file PrometheusLoggerMetrics.hpp.
◆ counter_to_int64()
| static int64_t logit::PrometheusLoggerMetrics::counter_to_int64 |
( |
uint64_t | value | ) |
|
|
inlinestatic |
◆ dropped_count()
| uint64_t logit::PrometheusLoggerMetrics::dropped_count |
( |
| ) |
const |
|
inline |
◆ failed_export_count()
| uint64_t logit::PrometheusLoggerMetrics::failed_export_count |
( |
| ) |
const |
|
inline |
◆ last_log_ts()
| int64_t logit::PrometheusLoggerMetrics::last_log_ts |
( |
| ) |
const |
|
inline |
◆ log_records_total()
| uint64_t logit::PrometheusLoggerMetrics::log_records_total |
( |
| ) |
const |
|
inline |
◆ on_log()
| void logit::PrometheusLoggerMetrics::on_log |
( |
int64_t | timestamp_ms | ) |
|
|
inline |
◆ time_since_last_log_ms()
| int64_t logit::PrometheusLoggerMetrics::time_since_last_log_ms |
( |
int64_t | now_ms | ) |
const |
|
inline |
◆ m_dropped
| std::atomic<uint64_t> logit::PrometheusLoggerMetrics::m_dropped {0} |
|
private |
◆ m_failed_exports
| std::atomic<uint64_t> logit::PrometheusLoggerMetrics::m_failed_exports {0} |
|
private |
◆ m_last_log_ts
| std::atomic<int64_t> logit::PrometheusLoggerMetrics::m_last_log_ts {0} |
|
private |
◆ m_log_records_total
| std::atomic<uint64_t> logit::PrometheusLoggerMetrics::m_log_records_total {0} |
|
private |
The documentation for this class was generated from the following file: