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
View File
@@ -380,6 +380,10 @@ impl RegistryGet for Server {
spam_sample_get(get).await.map(|get| get.into_response())
}
ObjectType::Log => log_get(get).await.map(|get| get.into_response()),
// inbuxa: monitoring history (MON-17, MON-31)
ObjectType::Metric => crate::inbuxa::telemetry::metric_get(get)
.await
.map(|get| get.into_response()),
ObjectType::Bootstrap => bootstrap_get(get).await.map(|get| get.into_response()),
ObjectType::AccountSettings
| ObjectType::ApiKey
+4 -18
View File
@@ -17,23 +17,9 @@ pub trait EnterpriseRegistry {
}
impl EnterpriseRegistry for Server {
fn assert_enterprise_object(&self, object_type: ObjectType) -> trc::Result<()> {
if !matches!(
object_type,
ObjectType::Metric
| ObjectType::Trace
) {
return Ok(());
}
// These are the Enterprise features INBUXA hasn't rebuilt yet
// (docs/spec/SPEC.md §4). Each type leaves this list when its rebuild
// lands. There's no edition to upgrade to, so the message says so.
Err(trc::JmapEvent::Forbidden.into_err().details(concat!(
"This feature isn't available in ",
types::brand!(),
" yet."
)))
// inbuxa: every Enterprise feature is rebuilt (docs/spec/SPEC.md §4), the
// last being monitoring (MON-39), so nothing is refused here any more
fn assert_enterprise_object(&self, _: ObjectType) -> trc::Result<()> {
Ok(())
}
}
+9
View File
@@ -122,6 +122,15 @@ impl RegistryQuery for Server {
.await
.and_then(|response| response.build()),
// inbuxa: monitoring history (MON-17, MON-31)
ObjectType::Metric => crate::inbuxa::telemetry::metric_query(RegistryQueryResponse {
server: self,
access_token,
object_type,
request,
})
.await
.and_then(|response| response.build()),
ObjectType::Log => log_query(RegistryQueryResponse {
server: self,
access_token,