Alerting Best Practices: Alerts Without Burnout
It is 3 a.m. and your phone buzzes: "CPU above 80% on web-7." You get up, open the laptop, and find that users are fine and the CPU has already dropped. The next night it happens twice. By Friday you swipe these pages away without reading them, and that is exactly when a real outage slips through. This lesson covers the alerting best practices that keep pages rare, meaningful and actionable, so being on call does not burn you out.
Why noisy alerts are dangerous
An alert is a rule that watches a measurement and sends a notification when it crosses a line. A page is the loudest kind: it interrupts a person right now, by phone call or push notification, day or night. A ticket is a work item someone handles during working hours. Most alerts should be tickets or dashboard panels, not pages.
Alert fatigue is what happens when people receive many alerts that need no action. They learn, reasonably, that alerts can be ignored. Responses get slower, real pages get missed, and the people on call get tired. Google's SRE book suggests at most two incidents per 12-hour on-call shift, so that each one gets a proper investigation and follow-up (Being On-Call).
Alert on symptoms users feel
A symptom is something users experience: errors, slow responses, a checkout that fails. A cause is an internal reason that might lead to a symptom: high CPU, a long queue, one dead replica out of ten. Cause-based alerts fail in both directions. They fire when users are fine, such as a busy CPU on a server that still answers quickly, and they stay silent for problems nobody predicted, such as a bad config that returns errors at 10% CPU.
The best symptom alert watches the error budget from the SLI, SLO and SLA lesson. Its burn rate is the observed error ratio divided by the allowed one, so at a 99.9% SLO a 1.44% error ratio is a burn rate of 14.4. Sustained for one hour, that spends 14.4 × 1 ÷ 720 = 2% of a 30-day budget, since 30 days is 720 hours. The Google SRE Workbook recommends three tiers (Alerting on SLOs):
| Budget spent | Long window | Short window | Burn rate | Error ratio at 99.9% | Action |
|---|---|---|---|---|---|
| 2% | 1 hour | 5 minutes | 14.4 | 1.44% | page |
| 5% | 6 hours | 30 minutes | 6 | 0.6% | page |
| 10% | 3 days | 6 hours | 1 | 0.1% | ticket |
Each tier checks two windows. The long window proves that a meaningful share of the budget has gone. The short window, one twelfth as long, proves the problem is still happening, so the alert clears within minutes of a fix instead of an hour later. Here is the first tier as a Prometheus alerting rule:
groups:
- name: checkout-slo
rules:
- alert: CheckoutErrorBudgetBurn
expr: |
(
sum(rate(http_requests_total{job="checkout",code=~"5.."}[1h]))
/ sum(rate(http_requests_total{job="checkout"}[1h]))
) > (14.4 * 0.001)
and
(
sum(rate(http_requests_total{job="checkout",code=~"5.."}[5m]))
/ sum(rate(http_requests_total{job="checkout"}[5m]))
) > (14.4 * 0.001)
for: 2m
labels:
severity: page
annotations:
summary: "Checkout is spending its 30-day error budget 14.4x too fast"
dashboard_url: "https://grafana.example.com/d/checkout-overview"
runbook_url: "https://runbooks.example.com/checkout/error-budget-burn"
Each half of the expression divides failed requests (status 5xx) by all requests over its window, and and makes the alert fire only when both ratios are above 1.44%. Larger setups precompute these ratios as recording rules, saved queries with names like slo:checkout_errors:ratio_rate1h, so alert expressions stay short. Keep cause metrics such as CPU on dashboards, where they help you diagnose a symptom after it has paged you.
Page only when a human must act now
Before any alert becomes a page, ask two questions. Is a user affected now, or about to be? Can a human do something useful about it? An alert that fails the first question is a ticket or a dashboard panel. An alert that fails the second should be deleted, or its fix automated, for example with an automatic restart. Only alerts that pass both earn the right to wake someone.
Record the answer in a severity label on the rule, such as severity: page or severity: ticket. Labels are key-value pairs attached to the alert, and the alert router uses them to decide who hears about it and how.
Filter blips with for, then group related alerts
Prometheus evaluates every rule on a fixed interval, often every 15 seconds or 1 minute. When the expression first comes back true, the alert is pending. The for field sets the pending duration: the expression must stay true at every evaluation for that long before the alert becomes firing and is sent on. If it turns false once, the timer starts again, so a 30-second spike during a deploy never pages anyone.
The cost is delay: for: 5m makes every real page at least five minutes late. Choose it per alert. Burn-rate alerts already average over their windows, so a short for of a minute or two is enough.
Firing alerts go to Alertmanager, the Prometheus component that groups, silences and routes notifications. Grouping turns 30 pods failing the same way into one message instead of 30. This route sends one notification per alert name and service, and sends only severity="page" alerts to the pager:
route:
receiver: team-tickets
group_by: ['alertname', 'service']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers: ['severity="page"']
receiver: team-pager
group_wait collects related alerts for 30 seconds before the first message, group_interval spaces out updates when new alerts join a group, and repeat_interval re-sends a still-firing alert every 4 hours. These three values are also Alertmanager's defaults. Everything without the page label lands in the ticket receiver.
Give every alert context, then keep pruning
A page arrives on a phone screen, often at night. The reader needs four things straight away: what is wrong and for whom, how bad it is, where to look, and what to do. Put them in annotations, free-text fields on the rule: a one-line summary, a dashboard_url and a runbook_url. A runbook is a short document listing what to check and how to fix the problem. Annotations can also insert label values, such as the failing instance, using Prometheus templates.
Alerts rot. Services change, thresholds drift, and an alert that once mattered starts firing for nothing. Count pages per on-call shift, and at each handover ask of every page: did someone take an action because of it? Delete or downgrade any alert that nobody has acted on in a month.
Check yourself
CPU is at 92% on one server, but the error rate and latency are normal. Should this page someone?
No: no user is affected, so it belongs on a dashboard or, at most, in a ticket.
At a 99.9% SLO, what error ratio is a burn rate of 14.4, and how much of a 30-day budget does one hour of it spend?
1.44% (14.4 × 0.1%), and it spends 2% of the budget, because 14.4 × 1 hour ÷ 720 hours = 0.02.
What does for: 5m do, and what does it cost you?
The condition must hold at every evaluation for 5 minutes before the alert fires, so every real page also arrives at least 5 minutes later.
Go deeper
- On-Call Best Practices: Preventing Burnout: once your alerts are clean, this covers the rotations, handovers and follow-up habits that keep the people behind the pager healthy.