Interview Prep/Monitoring & Observability/PromQL and recording rules

`histogram_quantile` result jumps wildly between refreshes

AdvancedTroubleshootingPromQL and recording rules
Answer

Likely causes → le was dropped or aggregated incorrectly (sum without(le)), buckets are mixed across services with different boundaries, or the window is too short for low traffic.

Diagnose → Check the inner expression keeps le: sum by (le, service) (rate(..._bucket[5m])).

Fix → Always aggregate with by (le, ...), do not mix histograms with different bucket layouts, widen the window.

Prevent → Wrap quantile queries in recording rules such as service:http_request_duration_seconds:p99_5m.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on PromQL and recording rules