BM: Baca dalam Bahasa Melayu
World O2: Counters
Counter, gauge, histogram, summary
You will learn: the four kinds of metrics, and why a counter can suddenly drop to 0.
Checked with Prometheus 3 on 1 Nov 2026
The problem
The Bangsar orders counter said 225. A minute later it says 0. Did customers cancel every order?
Pick one answer.
Watch
Tap the counter.
0 of 1 found
Every metric has a type. A counter: A number that only goes up, like orders served. It drops to 0 only when the app restarts. only goes up, like orders served. These lines are from a real Prometheus.
Try it
Show the customers waiting. Then slide the time.
Tap kedai_customers_waiting, then Run. Watch the graph go up and down.
A number that goes up and down is a gauge: A number that goes up and down, like customers waiting or free memory..
Try it
Counter or gauge? Sort each number.
Drag a card into a box. Or tap the card, then tap the box.
Watch
A histogram: Counts requests into time buckets (le = less or equal), plus a _sum and a _count. counts requests into buckets. le means “less or equal”. All 3 requests here took 0.1 s or less.
Try it
Buckets count everything below them. le="0.25" says 100. le="0.5" says 114. How many took between 0.25 s and 0.5 s?
Pick one answer.
Check
A summary: Quantiles worked out inside the app. You cannot add them up across servers. works out quantiles inside the app. Histogram or summary? Sort each one.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now tell counters, gauges, histograms and summaries apart.
Go deeper (optional)
Names help: counters end in _total; units go in the name, like _seconds or _bytes. Prometheus 3 also has native histograms, with buckets built in. You turn them on with scrape_native_histograms. This course uses the classic le buckets.
Real mission
docker compose up -dcurl -s localhost:9090/metrics | grep '^# TYPE'docker compose down
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Counter pesanan Bangsar tunjuk 225. Seminit kemudian ia tunjuk 0. Adakah pelanggan batalkan semua pesanan?
Setiap metrik ada jenis. Counter (pembilang) hanya naik, seperti pesanan yang siap. Baris ini daripada Prometheus sebenar.
Tunjuk pelanggan yang menunggu. Kemudian luncurkan masa.
Nombor yang naik dan turun ialah gauge (meter).
Counter atau gauge? Susun setiap nombor.
Histogram kira permintaan ke dalam baldi. le bermaksud “kurang atau sama”. Semua 3 permintaan di sini ambil 0.1 s atau kurang.
Baldi kira semua yang di bawahnya. le="0.25" kata 100. le="0.5" kata 114. Berapa yang ambil antara 0.25 s dan 0.5 s?
Summary kira kuantil dalam aplikasi. Histogram atau summary? Susun setiap satu.
Kini anda boleh bezakan counter, gauge, histogram dan summary.
You finished this before. Practice is always welcome!
Official docs: Prometheus: metric types · Prometheus: histograms and summaries · Prometheus: metric and label naming
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?