Step 5 of 6 · lab · 30 min
The full-volume alert stays silent
The volume with exports on the reports server has run out twice at night, and nobody found out. A colleague added an alert rule for an almost full volume to Prometheus, yet yesterday the volume filled up again with no alert. Make the alert fire in time and clear when the space is freed.
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 · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
The DiskAlmostFull rule is loaded into the running Prometheus from the rule files, promtool check config passes — not done yet
-
When less than 10 % of /srv/data is free, the DiskAlmostFull alert fires — firing — within a minute — not done yet
-
When more than 10 % is free again, the alert clears — not done yet
-
Prometheus and node_exporter are enabled and run with the settings from their files — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
The DiskAlmostFull rule is loaded into the running Prometheus from the rule files, promtool check config passes — not done yet
-
When less than 10 % of /srv/data is free, the DiskAlmostFull alert fires — firing — within a minute — not done yet
-
When more than 10 % is free again, the alert clears — not done yet
-
Prometheus and node_exporter are enabled and run with the settings from their files — not done yet
Goals are checked on the machine after every command.