Linux Labs

Observability: metrics, alerts, logs / Stage 4 of 9 · step 5 of 6

The full-volume alert stays silent

medium ~30 min
Not running Starting usually ~20 s
Report a problem

Situation

The reports server has a /srv/data volume where the nightly sales exports go. Two weeks ago it ran out of space at night, the reports were not built in the morning, and the team learned about it from accounting. A colleague added the DiskAlmostFull alert rule for an almost full volume to Prometheus — the rule files live in /etc/prometheus/rules/ — reloaded the configuration and went on holiday. Yesterday the volume filled up again. There was no alert.

Prometheus and node_exporter are running on the machine; metrics are scraped and rules are evaluated every 5 seconds. There is no browser: you see Prometheus only from the terminal — curl -s localhost:9090/api/v1/… | jq, promtool. sudo works without a password.

Task

  1. The DiskAlmostFull rule is loaded into the running Prometheus from the rule files, and promtool check config /etc/prometheus/prometheus.yml passes.
  2. When less than 10 % of /srv/data is free, the DiskAlmostFull alert fires — goes to the firing state — within a minute: the nightly export fills the volume quickly.
  3. When more than 10 % is free again, the alert clears.
  4. Prometheus and node_exporter are enabled and run with the settings from their files.

The check fills the volume with a temporary file itself, waits for the alert and deletes the file. You can test your rule the same way: sudo fallocate -l 50M /srv/data/test, and afterwards sudo rm /srv/data/test. Leave the exports in /srv/data/reports alone.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • The DiskAlmostFull rule is loaded into the running Prometheus from the rule files, promtool check config passes — not checked yet
  • When less than 10 % of /srv/data is free, the DiskAlmostFull alert fires — firing — within a minute — not checked yet
  • When more than 10 % is free again, the alert clears — not checked yet
  • Prometheus and node_exporter are enabled and run with the settings from their files — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…