Know When a Service Stops Reporting
A small online shop's Prometheus scrapes its services in the job shop. Last week the team added a sixth service, search, to the scrape configuration. Its dashboard panels have been empty ever since, and no alert said anything.
| 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. Prometheus reads /etc/obs/prometheus.yml and the rules in /etc/obs/rules.yml.
Add a rule group named shop-targets to /etc/obs/rules.yml with two alerts, both with the label severity: page:
ShopTargetDown: fires for each target of the job shop that Prometheus can't scrape, after 1 minute. Each alert must carry the target's service label. Right now it must be pending or firing for search, and only for it.ShopMetricsAbsent: fires after 5 minutes if Prometheus has no target of the job shop at all (for example, someone deleted the job from the configuration). Right now it must not be pending or firing.Don't fix or remove the search target: the service team is on it.
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: An Error-Budget Burn Alert
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.