Observability: metrics, alerts, logs / Stage 4 of 9 · step 5 of 6
The full-volume alert stays silent
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
- The
DiskAlmostFullrule is loaded into the running Prometheus from the rule files, andpromtool check config /etc/prometheus/prometheus.ymlpasses. - When less than 10 % of
/srv/datais free, theDiskAlmostFullalert fires — goes to thefiringstate — within a minute: the nightly export fills the volume quickly. - When more than 10 % is free again, the alert clears.
- 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 afterwardssudo rm /srv/data/test. Leave the exports in/srv/data/reportsalone.
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