From 7b2038e51d0f44796518d6091d95b2e77a16af04 Mon Sep 17 00:00:00 2001 From: David Estes Date: Thu, 6 Jun 2024 10:27:37 -0600 Subject: [PATCH 1/3] chore: all metrics under 'ceramic_one' prom registry --- metrics/src/core.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/src/core.rs b/metrics/src/core.rs index bfe4cf0a2..6e00eb3c1 100644 --- a/metrics/src/core.rs +++ b/metrics/src/core.rs @@ -16,7 +16,7 @@ pub(crate) struct Core { impl Default for Core { fn default() -> Self { - let mut reg = Registry::default(); + let mut reg = Registry::with_prefix("ceramic_one"); Core { bitswap_metrics: bitswap::Metrics::new(&mut reg), libp2p_metrics: libp2p::metrics::Metrics::new(&mut reg), From 831f1cdb8bcbb62adf26c7db693468545e6b4411 Mon Sep 17 00:00:00 2001 From: David Estes Date: Thu, 6 Jun 2024 10:48:11 -0600 Subject: [PATCH 2/3] chore: rename store metrics was "ceramic_store_store_query_durations" and with the new c1 prefix "ceramic_one_ceramic_store_store_query_durations" and now "ceramic_one_store_query_durations" --- store/src/metrics.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/store/src/metrics.rs b/store/src/metrics.rs index 855d4e960..5018928a4 100644 --- a/store/src/metrics.rs +++ b/store/src/metrics.rs @@ -43,13 +43,13 @@ impl From<&StorageQuery> for QueryLabels { pub struct Metrics { key_value_insert_count: Counter, - store_query_durations: Family, + query_durations: Family, } impl Metrics { /// Register and construct Metrics pub fn register(registry: &mut Registry) -> Self { - let sub_registry = registry.sub_registry_with_prefix("ceramic_store"); + let sub_registry = registry.sub_registry_with_prefix("store"); register!( key_value_insert_count, @@ -59,7 +59,7 @@ impl Metrics { ); register!( - store_query_durations, + query_durations, "Durations of store queries in seconds", Family::::new_with_constructor(|| { Histogram::new(exponential_buckets(0.005, 2.0, 20)) @@ -69,7 +69,7 @@ impl Metrics { Self { key_value_insert_count, - store_query_durations, + query_durations, } } } @@ -83,7 +83,7 @@ impl Recorder for Metrics { impl Recorder for Metrics { fn record(&self, event: &StorageQuery) { let labels: QueryLabels = event.into(); - self.store_query_durations + self.query_durations .get_or_create(&labels) .observe(event.duration.as_secs_f64()); } From 8b75a9c2a07165fe0ff58546d94412c1f8417748 Mon Sep 17 00:00:00 2001 From: David Estes Date: Thu, 6 Jun 2024 11:09:19 -0600 Subject: [PATCH 3/3] chore: rename http_api_http_api metric http_api_info --- one/src/http_metrics.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/one/src/http_metrics.rs b/one/src/http_metrics.rs index 5804074b4..69012e606 100644 --- a/one/src/http_metrics.rs +++ b/one/src/http_metrics.rs @@ -62,11 +62,7 @@ impl Metrics { api_version: ceramic_api_server::API_VERSION, kubo_api_version: ceramic_kubo_rpc_server::API_VERSION, }); - sub_registry.register( - "http_api", - "Information about the Ceramic and Kubo APIs", - info, - ); + sub_registry.register("info", "Information about the Ceramic and Kubo APIs", info); Self { requests,