How do histogram_quantile and the le label work?
⚡
Quick Answer
histogram_quantile estimates a percentile from cumulative _bucket series; the le (less-than-or-equal) label must be preserved.
Detailed Answer
Histograms expose _bucket series labeled by le boundaries. histogram_quantile(0.99, sum by (le) (rate(x_bucket[5m]))) estimates p99. You must keep le in the aggregation, or the function has nothing to interpolate over. It's an estimate whose accuracy depends on bucket boundaries.
💡
Interview Tip
Always keep le in the by() — the classic mistake.
prometheushistogramquantile