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.
This commit is contained in:
Anna Khanova
2023-11-30 17:33:54 +01:00
committed by GitHub
parent eba3bfc57e
commit 3657a3c76e
2 changed files with 3 additions and 3 deletions

View File

@@ -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
}
}

View File

@@ -117,7 +117,7 @@ pub static CONSOLE_REQUEST_LATENCY: Lazy<HistogramVec> = 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<Histogram> = 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()