fix(metrics): extend LLM latency histogram buckets - #385
Conversation
Signed-off-by: Yahoo <119646314+y4ho0@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThe metrics provider adds explicit latency buckets through five minutes for model-call and total LLM latency histograms. The view records minimum and maximum values. Server metrics tests verify the new bucket. ChangesLLM latency metrics
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
|
@grahamking Can you review this one ? |
What
Why
The OpenTelemetry SDK defaults stop at 10 seconds, so slower model calls fall into the
+Infbucket. That makes Prometheus quantiles unable to distinguish a 10-second response from a multi-minute LLM generation.The dedicated view keeps the existing short-latency resolution while making the long tail observable.
Closes #262
How tested
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p switchyard-server— 56 tests passedcargo test --workspace --exclude switchyard-py— 490 tests and doctests passedA full workspace run was also attempted. It reached the unchanged
switchyard-pycdylib and stopped on local macOS CPython symbol linking; all non-PyO3 workspace tests passed.Checklist
Notes for reviewers
The boundaries are fixed to keep this bug fix focused, matching the existing routing-overhead view. Making them configurable can remain a separate change if operators need deployment-specific ranges.
Summary by CodeRabbit
New Features
Tests