Interview Prep/Monitoring & Observability/Prometheus and PromQL at Scale

Choose histogram bucket boundaries for a service with a 300 ms latency SLO.

AdvancedScenarioPrometheus and PromQL at Scale
Answer

Situation read → histogram_quantile interpolates inside a bucket, so accuracy depends on bucket layout. Default buckets (0.005 to 10) waste resolution near your SLO.

What I'd do →

  1. Put a bucket exactly at 0.3 so the SLO ratio is exact: rate(..._bucket{le="0.3"}) / rate(..._count).
  2. Add dense buckets around the target: 0.05, 0.1, 0.2, 0.25, 0.3, 0.35, 0.4, 0.5, 0.75, 1, 2.5, 5.
  3. Keep the number of buckets modest (10–15), since each is a series multiplied by label combinations.
  4. Consider native histograms (Prometheus 3.x) which remove manual bucket choices.

Why → SLO compliance should come from exact bucket counts, not interpolation guesses.

Interview tip → Mention that changing bucket boundaries later breaks aggregation across old and new series.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus and PromQL at Scale