Monitoring: metric history, one edition of metrics, and x:Metric over the stored samples (MON-4 to MON-7, MON-9, MON-17, MON-39)

Every node writes a sample per metric on metricsCollectionInterval:
counters as the increase since its last sample, gauges always, histograms
as totals when changed. Samples are x:Metric in the registry's encoding
under the telemetry key class, ids time-ordered. x:Metric/get and /query
read them with metric and timestamp filters and full paging, hide what's
past holdMetricsFor, and the data purge deletes it. The is_enterprise
split is gone, so every gauge and histogram is collected and exported, and
queue.count is set from the queue itself. The shared metrics suite runs.
This commit is contained in:
2026-09-19 08:21:45 -07:00
parent 715f219528
commit 9f7035588f
18 changed files with 586 additions and 64 deletions
+4 -4
View File
@@ -17,12 +17,12 @@ use std::time::SystemTime;
use trc::{Collector, TelemetryEvent};
impl OtelMetrics {
pub async fn push_metrics(&self, is_enterprise: bool, start_time: SystemTime) {
pub async fn push_metrics(&self, start_time: SystemTime) {
let mut metrics = Vec::with_capacity(256);
let time = SystemTime::now();
// Add counters
for counter in Collector::collect_counters(is_enterprise) {
for counter in Collector::collect_counters() {
metrics.push(Metric::new(
counter.id().as_str(),
counter.id().description(),
@@ -38,7 +38,7 @@ impl OtelMetrics {
}
// Add gauges
for gauge in Collector::collect_gauges(is_enterprise) {
for gauge in Collector::collect_gauges() {
metrics.push(Metric::new(
gauge.id().as_str(),
gauge.id().description(),
@@ -52,7 +52,7 @@ impl OtelMetrics {
}
// Add histograms
for histogram in Collector::collect_histograms(is_enterprise) {
for histogram in Collector::collect_histograms() {
metrics.push(Metric::new(
histogram.id().as_str(),
histogram.id().description(),