Skip to content

Add larger request duration histogram bucket to better identify slow requests #5815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions quickwit/quickwit-search/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ pub struct SearchMetrics {
pub searcher_local_kv_store_size_bytes: IntGauge,
}

/// From 0.008s to 131.072s
fn duration_buckets() -> Vec<f64> {
exponential_buckets(0.008, 2.0, 15).unwrap()
}

impl Default for SearchMetrics {
fn default() -> Self {
let targeted_splits_buckets: Vec<f64> = [
Expand Down Expand Up @@ -85,7 +90,7 @@ impl Default for SearchMetrics {
"search",
&[("kind", "server")],
["status"],
exponential_buckets(0.001, 2.0, 15).unwrap(),
duration_buckets(),
),
root_search_targeted_splits: new_histogram_vec(
"root_search_targeted_splits",
Expand All @@ -108,7 +113,7 @@ impl Default for SearchMetrics {
"search",
&[("kind", "server")],
["status"],
exponential_buckets(0.001, 2.0, 15).unwrap(),
duration_buckets(),
),
leaf_search_targeted_splits: new_histogram_vec(
"leaf_search_targeted_splits",
Expand All @@ -129,7 +134,7 @@ impl Default for SearchMetrics {
"Number of seconds required to run a leaf search over a single split. The timer \
starts after the semaphore is obtained.",
"search",
exponential_buckets(0.001, 2.0, 15).unwrap(),
duration_buckets(),
),
leaf_search_single_split_tasks_ongoing: leaf_search_single_split_tasks
.with_label_values(["ongoing"]),
Expand Down
3 changes: 2 additions & 1 deletion quickwit/quickwit-serve/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ impl Default for ServeMetrics {
"",
&[],
["method", "status_code"],
quickwit_common::metrics::exponential_buckets(0.02, 2.0, 8).unwrap(),
// last bucket is 163.84s
quickwit_common::metrics::exponential_buckets(0.02, 2.0, 14).unwrap(),
),
ongoing_requests: new_gauge_vec(
"ongoing_requests",
Expand Down