From 3657a3c76e8b794997caf01baa80044626c82049 Mon Sep 17 00:00:00 2001 From: Anna Khanova <32508607+khanova@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:33:54 +0100 Subject: [PATCH] Proxy fix metrics record (#5996) ## Problem Some latency metrics are recorded in inconsistent way. ## Summary of changes Make sure that everything is recorded in seconds. --- proxy/src/http.rs | 2 +- proxy/src/proxy.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/src/http.rs b/proxy/src/http.rs index 638705d3e9..09423eca77 100644 --- a/proxy/src/http.rs +++ b/proxy/src/http.rs @@ -95,7 +95,7 @@ impl Endpoint { let res = self.client.execute(request).await; CONSOLE_REQUEST_LATENCY .with_label_values(&[&path]) - .observe(start.elapsed().as_micros() as f64); + .observe(start.elapsed().as_secs_f64()); res } } diff --git a/proxy/src/proxy.rs b/proxy/src/proxy.rs index 2af2dd5562..c4bea13f7f 100644 --- a/proxy/src/proxy.rs +++ b/proxy/src/proxy.rs @@ -117,7 +117,7 @@ pub static CONSOLE_REQUEST_LATENCY: Lazy = Lazy::new(|| { // proxy_wake_compute/proxy_get_role_info &["request"], // largest bucket = 2^16 * 0.2ms = 13s - exponential_buckets(0.2, 2.0, 16).unwrap(), + exponential_buckets(0.0002, 2.0, 16).unwrap(), ) .unwrap() }); @@ -136,7 +136,7 @@ pub static RATE_LIMITER_ACQUIRE_LATENCY: Lazy = Lazy::new(|| { register_histogram!( "semaphore_control_plane_token_acquire_seconds", "Time it took for proxy to establish a connection to the compute endpoint", - // largest bucket = 3^16 * 0.00005s = 3.28s + // largest bucket = 3^16 * 0.00005ms = 2.15s exponential_buckets(0.00005, 3.0, 16).unwrap(), ) .unwrap()