Alerting without alert fatigue: Prometheus and Alertmanager
Good alerting fires only on symptoms a human must act on, waits with a for duration to avoid blips, separates pages from tickets and uses Alertmanager to group, inhibit and silence notifications.
- Updated Nov 27, 2026
- Markdown
Write a Prometheus alert rule with a for duration and a runbook link, and understand grouping, inhibition and silences.
- Prometheus scraping at least one target
- A chat or email destination for alerts
How an alert reaches the right person
- A rule stays true for its whole for duration, so Prometheus sends a firing alert to Alertmanager.
- Alertmanager groups related alerts, skips silenced ones, and pages the person on call for a critical alert.
- A warning that can wait until working hours becomes a ticket or a chat message instead.
Static diagram
- PrometheusfiringAlertmanager
- AlertmanagercriticalPage
- AlertmanagerwarningTicket
Alert on symptoms users feel, not on every number that moves. Give each alert a for duration so brief spikes do not fire it, decide up front whether it pages a person or opens a ticket, let Alertmanager group related alerts into one message, and attach a runbook link so whoever receives it knows what to do. Fewer alerts that each demand action beat many that get ignored.
How it works#
Prometheus evaluates alert rules on a schedule. When an expression returns results, the alert becomes pending, and after the for duration it becomes firing. Prometheus sends firing alerts to Alertmanager, which handles delivery: grouping, deduplication, routing to receivers like email or a chat webhook, silences and inhibition. The diagram above shows that path. Prometheus decides what is wrong, Alertmanager decides who hears about it and how.
Alert fatigue happens when people receive many unimportant alerts and begin to ignore all of them. The fixes are social as much as technical: every alert must have an owner, an action and a reason to exist.
Alert on symptoms#
A symptom is what a user or the business feels: the site returns errors, pages take too long, checkout fails, a backup did not run. A cause is an internal fact that might lead to a symptom: CPU is high, a container restarted, swap is used.
Page on symptoms. Keep causes on dashboards, where you read them while investigating. Some causes are worth alerting on because they predict an unavoidable symptom soon, such as a disk that will be full in four hours. The first outside check from uptime checks with a script and timer is the model symptom alert.
Step 1: Write a rule with a for duration#
Create /etc/prometheus/rules/basic.yml:
groups:
- name: basic
rules:
- alert: TargetDown
expr: up == 0
for: 5m
labels:
severity: page
annotations:
summary: "{{ $labels.instance }} is not being scraped"
runbook_url: "https://example.com/runbooks/target-down"
- alert: DiskAlmostFull
expr: |
node_filesystem_avail_bytes{mountpoint="/"}
/ node_filesystem_size_bytes{mountpoint="/"} < 0.10
for: 15m
labels:
severity: ticket
annotations:
summary: "Less than 10 percent free on / at {{ $labels.instance }}"
runbook_url: "https://example.com/runbooks/disk-full"The for values are starting points. Short enough that a real outage is not delayed too long, long enough that a restart or a log burst does not wake anyone. The 10 percent figure is also a starting point, tuned in disk, memory and CPU alerts that matter.
Step 2: Validate and load the rules#
Reference the file in prometheus.yml:
rule_files:
- /etc/prometheus/rules/*.ymlCheck both before restarting:
promtool check rules /etc/prometheus/rules/basic.yml
promtool check config /etc/prometheus/prometheus.yml
sudo systemctl restart prometheusOpen the Alerts page in the Prometheus web UI, through an SSH tunnel, to see each rule as inactive, pending or firing. Keep that UI private, as covered in Prometheus and node exporter basics.
Step 3: Route, group and silence with Alertmanager#
A minimal alertmanager.yml groups by alert name and instance and sends the page severity to a webhook receiver:
route:
receiver: ticket
group_by: ["alertname", "instance"]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers:
- severity="page"
receiver: pager
receivers:
- name: pager
webhook_configs:
- url: "https://example.com/hook"
- name: ticket
webhook_configs:
- url: "https://example.com/hook-tickets"
inhibit_rules:
- source_matchers:
- alertname="TargetDown"
target_matchers:
- severity="ticket"
equal: ["instance"]Validate it with amtool check-config alertmanager.yml. Grouping means 20 servers failing at once send one message listing them. The inhibition rule mutes ticket-level alerts for a host while TargetDown is firing for it, since a dead host makes the rest noise. A silence is the manual version: mute matching alerts for a time window during planned maintenance, and let it expire by itself. Replace the example webhook URLs and keep any tokens out of the file in git.
Pages versus tickets#
Decide severity before the alert exists. A page means “someone must act now, and the user is affected or will be soon.” A ticket means “this needs fixing this week.” If you cannot say what a person would do at 3 a.m. after getting it, it is not a page. A certificate expiring in three weeks is a ticket. The site returning errors is a page. Mapping severities to receivers, as above, makes the choice mechanical.
Check it worked#
promtool check rulesreports the number of rules found and no errors.- Stop node_exporter for longer than the
fortime andTargetDowngoes pending, then firing. - One message arrives at the
pagerreceiver, not one per minute. - Restart node_exporter and the alert resolves.
- The runbook link in the message opens a page that says what to do.
Edge cases and gotchas#
- No
for, flappy alerts. A rule withoutforfires on any single bad sample, including during restarts. - Too long
for. A 30 minute delay on a page means 30 minutes of unnoticed outage. Match it to how fast the problem hurts. - Silences forgotten. Always set an expiry and a comment. An indefinite silence is an alert you deleted without saying so.
- Alertmanager itself fails silently. Watch that Prometheus can reach it, and consider an always-firing “heartbeat” alert that an external service expects.
- Repeat intervals too short. Repeating the same alert every few minutes feels like spam. Hours is usually enough.
- Runbooks rot. Review them after each incident. A wrong runbook is worse than none.
Troubleshooting#
| Symptom | Likely cause | Fix |
|---|---|---|
promtool check rules prints FAILED | YAML or PromQL error | Fix the line shown in the message |
Alert stays pending forever | Condition flips on and off | Lengthen the window or use avg_over_time |
| Alert fires but no message | Prometheus not pointed at Alertmanager | Add the alerting block with the target address |
| Message sent but not delivered | Webhook URL or token wrong | Test the webhook with curl by hand |
| 20 messages for one outage | No grouping | Set group_by and group_wait |
| Alerts muted unexpectedly | Active silence or inhibition | List silences with amtool silence query |
| Rules file ignored | Not listed in rule_files | Fix the glob path and restart |
| Alert never resolves | Expression still true or stale data | Check the expression in the graph view |
Quick reference#
promtool check rules /etc/prometheus/rules/basic.yml
amtool check-config /etc/alertmanager/alertmanager.yml
amtool silence add alertname=DiskAlmostFull --duration=2h --comment="planned work"
amtool silence queryRelated lessons#
- Disk, memory and CPU alerts that matter: concrete rules to start from.
- What to monitor first: which signals deserve an alert.
- Uptime checks with a script and timer: the simplest symptom alert.
- Grafana dashboards for CPU, memory and disk: where the causes belong.
- Build a public status page: tell users what you know during an incident.
Next#
Write real rules in disk, memory and CPU alerts that matter.
Check what you learned
Frequently asked questions
What is alert fatigue?
It is when people receive so many alerts, many of them unimportant, that they start ignoring all of them. Real incidents then get missed. The cure is fewer alerts that each demand action.
What does the for clause do in a Prometheus alert?
It requires the condition to stay true for the given time before the alert fires. for 10m means the expression must hold for ten minutes, which filters out short spikes.
What is the difference between a silence and an inhibition in Alertmanager?
A silence mutes matching alerts for a set time, usually by hand during maintenance. An inhibition rule automatically mutes some alerts while another, more important alert is firing, such as muting service alerts when the whole host is down.
How do I test an alert rule file?
Run promtool check rules on the file. It checks syntax and expressions before Prometheus loads them.
Sources
Keep going: guides and tutorials
- Our Health Check Failed and the Deploy Went Live Anyway A postmortem from our own dogfood run: a failed readiness probe still received traffic. What broke, why two correct parts added up to a bug, and the fix.
- Zero Downtime Deploy for Docker Apps, With Rollback How a Docker deploy waits for readiness before cutover, holds the previous release for rollback, rolls back on its own, and how to rehearse it.