BM: Baca dalam Bahasa Melayu
World O2: Counters
Instant and range vectors
You will learn: the difference between one value now and a window of values, and which one functions need.
Checked with Prometheus 3 on 1 Nov 2026
The problem
Two questions: “How many customers wait now?” and “What was the most in the last 10 minutes?” Same kind of answer?
Pick one answer.
Try it
One value per series, right now, is an instant vector: One value per series, at one moment. Graphs draw these.. Ask for a window instead.
Add [5m] right after the name, then Run. Count the samples in each row.
Predict
That window is a range vector: Every sample per series in a window, like [5m]. Functions like rate() need one.. Prometheus scrapes every 1m here. How many samples are in [5m]?
Pick one answer.
Try it
Run it and read the red message. Then fix it.
Find the most customers waiting in the last 10 minutes.
Hint
expected type range vector in plain words: give it a window, like [10m].Try it
Instant or range? Sort each query.
Drag a card into a box. Or tap the card, then tap the box.
Check
Can the graph draw kedai_customers_waiting[5m]?
Pick one answer.
You did it!
You can now tell instant vectors from range vectors and fix a missing window.
Go deeper (optional)
An instant query looks back up to 5 minutes for the newest sample. Prometheus 3 made windows left-open: (now − 5m, now]. The HTTP API names the type too. This answer is real:
Real mission
docker compose up -dcurl -s 'localhost:9090/api/v1/query?query=up'docker compose down
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Dua soalan: “Berapa pelanggan menunggu sekarang?” dan “Paling ramai berapa dalam 10 minit lepas?” Jenis jawapan yang sama?
Satu nilai untuk setiap siri, sekarang, ialah instant vector. Minta satu tetingkap pula.
Tetingkap itu ialah range vector. Prometheus scrape setiap 1m di sini. Berapa sampel dalam [5m]?
Jalankan dan baca mesej merah. Kemudian baikinya.
expected type range vector dalam bahasa mudah: beri ia tetingkap, seperti [10m].Instant atau range? Susun setiap query.
Boleh graf lukis kedai_customers_waiting[5m]?
Kini anda boleh bezakan instant vector dan range vector, dan baiki tetingkap yang tertinggal.
You finished this before. Practice is always welcome!
Official docs: Prometheus: querying basics · Prometheus: HTTP API · Prometheus 3 migration guide
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?