Five Questions for Prometheus
A small online shop had a rough hour, and the incident review needs a few facts from its metrics. The five services (frontend, cart, checkout, payments, inventory) expose, among others:
| Metric | Type | Meaning |
|---|---|---|
app_restarts_total | counter | times the service's container was restarted |
process_resident_memory_bytes | gauge | memory the process uses |
process_start_time_seconds | gauge | when the running process started (Unix time) |
app_build_info | gauge, always 1 | the running version, in the label version |
http_server_requests_total | counter | requests handled, labelled route and status |
Every series also has the label service.
| Tool | Holds | Address on this machine |
|---|---|---|
| Grafana | dashboards and Explore for the three below | http://127.0.0.1:3000 |
| Prometheus | metrics and alert rules | http://127.0.0.1:9090 |
| Loki | logs | http://127.0.0.1:3100 |
| Tempo | traces | http://127.0.0.1:3200 |
Open Prometheus with the button above the terminal.
Fill in /home/student/answers.txt (it already lists the five keys), one answer after each colon:
most_restarts: the service that restarted most often in the last hour.memory_peak_mib: the highest memory that service used in the last 30 minutes, in MiB (a whole number).checkout_requests_10m: how many requests checkout handled in the last 10 minutes (a whole number).payments_version: the version payments is running now.oldest_process: the service whose running process has been up the longest.About this machine
Ubuntu 24.04 with no internet access, running the real Prometheus, Loki, Tempo and Grafana (unmodified) and a simulated shop that reports to them. Once the machine is running, Grafana and Prometheus open in a new tab from the buttons above the terminal. The history goes back about an hour. curl, jq and promtool are installed. The grader checks your answer, not the commands you typed. BrokenCluster is not affiliated with, endorsed or sponsored by Grafana Labs or the Prometheus project.
Part of Observability in Practice. Next step: Recording Rules for the Shop
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.