Skip to content

Commit

Permalink
Adjust latency metrics buckets (#3379)
Browse files Browse the repository at this point in the history
## Motivation

We don't need to track latencies below 1ms IMHO. Also, for the server latency, I noticed it would very often just shoot to 50ms and stay there the whole time. If you're using few shards (1, like me, for example), shard latency can actually be fairly high.

## Proposal

Adjust things

## Test Plan

Check the changes on a local network

## Release Plan

- Nothing to do / These changes follow the usual release cycle.
  • Loading branch information
ndr-ds authored Feb 20, 2025
1 parent 5bec0eb commit c5c34a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions linera-rpc/src/grpc/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static SERVER_REQUEST_LATENCY: LazyLock<HistogramVec> = LazyLock::new(|| {
"server_request_latency",
"Server request latency",
&[],
bucket_interval(0.1, 50.0),
bucket_interval(1.0, 200.0),
)
});

Expand Down Expand Up @@ -95,7 +95,7 @@ static SERVER_REQUEST_LATENCY_PER_REQUEST_TYPE: LazyLock<HistogramVec> = LazyLoc
"server_request_latency_per_request_type",
"Server request latency per request type",
&["method_name"],
bucket_interval(0.1, 50.0),
bucket_interval(1.0, 200.0),
)
});

Expand Down
4 changes: 2 additions & 2 deletions linera-service/src/proxy/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use tracing::{debug, info, instrument, Instrument as _, Level};
#[cfg(with_metrics)]
use {
linera_base::prometheus_util::{
bucket_latencies, register_histogram_vec, register_int_counter_vec,
bucket_interval, register_histogram_vec, register_int_counter_vec,
},
prometheus::{HistogramVec, IntCounterVec},
};
Expand All @@ -71,7 +71,7 @@ static PROXY_REQUEST_LATENCY: LazyLock<HistogramVec> = LazyLock::new(|| {
"proxy_request_latency",
"Proxy request latency",
&[],
bucket_latencies(500.0),
bucket_interval(1.0, 500.0),
)
});

Expand Down

0 comments on commit c5c34a3

Please sign in to comment.