The team uses `histogram_quantile(0.99, ...)` on dashboards and wants to average p99 across 12 pods.
IntermediateScenarioObservability & Telemetry Decisions
Answer
Situation read → Percentiles cannot be averaged; the average of per-pod p99s is not the service p99.
What I'd do →
- Aggregate histogram buckets first, then compute the quantile:
histogram_quantile(0.99, sum by (le) (rate(http_request_duration_seconds_bucket{job="checkout"}[5m]))) - Remove
avg(histogram_quantile(...))panels. - Check bucket boundaries match the SLO threshold (for example a
0.3bucket for a 300 ms target). - Consider native histograms in Prometheus for better accuracy.
Why → Averaging percentiles hides tail latency, which is what users feel.
Interview tip → "Sum the buckets, then take the quantile" is the line.
More on Observability & Telemetry Decisions
Your team has metrics and logs but no tracing. A request to checkout fans out to 9 services and nobody can tell where the 2 seconds go. How do you introduce tracing?IntermediateThe monthly observability bill doubled in two months and finance wants it cut by 40%. What do you do?IntermediateA developer adds `customer_id` as a label to a request counter "for better debugging". You catch it in code review. What do you say?BeginnerYou need to pick a trace sampling strategy for a service doing 20,000 requests per second.AdvancedEvery team has built their own Grafana dashboards with different panels. During incidents, nobody can find anything.BeginnerA service's logs are unstructured strings like `Order 123 failed for user 9 after 3 retries`. Searching them during incidents is painful.Beginner