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
+6
View File
@@ -96,6 +96,12 @@ impl SnowflakeIdGenerator {
})
}
// inbuxa: the first id of a UNIX second, so ids can be searched by time
// (monitoring history)
pub fn first_id_at(timestamp: u64) -> u64 {
(timestamp.saturating_sub(DEFAULT_EPOCH) * 1000) << (SEQUENCE_LEN + NODE_ID_LEN)
}
pub fn to_timestamp(id: u64) -> u64 {
(id >> (SEQUENCE_LEN + NODE_ID_LEN)) / 1000 + DEFAULT_EPOCH
}