BM: Baca dalam Bahasa Melayu
World O2: Counters
Histograms and histogram_quantile
You will learn: how to find p95 from histogram buckets, and why an average can hide slow customers.
Checked with Prometheus 3 on 1 Nov 2026
The problem
The average checkout takes 0.39 s. Yet customers say checkout is slow. How can both be true?
Pick one answer.
Watch
A quantile (p95): p95 = 95% of requests were this fast or faster. The slowest 5% took longer. says: 95% of checkouts were this fast or faster. Build the recipe.
Tap the pieces in the right order.
Hint
Outside to inside: the quantile, then the sum, then the rate.Try it
Now run it. Then slide from 8m to 20m.
Wrap it: histogram_quantile(0.95, sum by (le) (…)). Then Run.
Predict
At 20m, p95 is 1.86 s. What does that mean?
Pick one answer.
Try it
A teammate wrote this. Run it: no answer. Fix it so each shop gets its own p95.
Keep le next to instance in the by list, then Run.
Hint
Nole, no buckets, no answer.Check
shop-1’s p95 is 2.29 s. shop-2’s is 0.42 s. Where do you look first?
Pick one answer.
You did it!
You can now find p95 with histogram_quantile and keep le in the sum.
Go deeper (optional)
histogram_quantile guesses inside a bucket, in a straight line. So pick bucket edges near your SLO, like 0.5 s. The average is rate(…_sum[5m]) divided by rate(…_count[5m]). Real rep: p90 for Prometheus’s own web pages.
Real mission
docker compose up -ddocker compose down
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Purata bayaran ambil 0.39 s. Tapi pelanggan kata bayaran lambat. Macam mana kedua-duanya boleh benar?
p95 bermaksud: 95% bayaran selaju ini atau lebih laju. Bina resepinya.
Sekarang jalankannya. Kemudian luncur dari 8m ke 20m.
Pada 20m, p95 ialah 1.86 s. Apa maksudnya?
Rakan sepasukan tulis ini. Jalankan: tiada jawapan. Baiki supaya setiap kedai dapat p95 sendiri.
le, tiada baldi, tiada jawapan.p95 shop-1 ialah 2.29 s. p95 shop-2 ialah 0.42 s. Di mana anda tengok dulu?
Kini anda boleh cari p95 dengan histogram_quantile dan simpan le dalam sum.
You finished this before. Practice is always welcome!
Official docs: PromQL functions: histogram_quantile() · Prometheus: histograms and summaries
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?