Writing

Designing alerts that only fire when a human needs to act

/9 min read/Reliability/#sre/#on-call/#alerting/#monitoring/#slo

Every time a pager goes off, it costs someone attention, sleep or both. That cost is fine when the page is the only thing standing between users and a bad outcome. It is not fine when the page is noise.

The goal of alert design is simple to state: a page fires when, and only when, a human needs to act. Everything else in this post is about getting closer to that.

1. Every page must be actionable, urgent and real

Before an alert is allowed to page anyone, it should pass three questions:

  • Actionable. Is there something the on-call engineer can do right now? If the answer is “watch it”, it is not a page.
  • Urgent. Does it need doing now, or can it wait until working hours? If it can wait, it is a ticket.
  • Real. Is it reflecting actual or imminent harm to users, rather than a blip that will clear on its own?

If an alert fails any one of these, it should not page. That does not mean deleting the signal. It means sending it somewhere cheaper.

2. Alert on symptoms, not causes

A symptom is what users experience: errors, slow responses, missing data. A cause is something that might lead to a symptom: high CPU, a full queue, one replica down.

Page on symptoms. Users do not care that CPU is at 95% if requests are still fast. And there are many more possible causes than symptoms, so cause-based paging grows without limit and still misses the failure you didn’t predict.

Cause-based signals still have a place:

  • On dashboards, to help diagnose a symptom once it has fired.
  • As tickets, when they predict trouble far enough ahead (a disk filling over days).
  • As pages, only when the cause reliably and quickly turns into user harm and there is no good symptom to watch.

3. Page, ticket or dashboard

Three destinations cover almost everything:

DestinationWhenWho looks
PageNeeds a human now, users are or will soon be affectedOn-call, immediately
TicketNeeds a human, but within hours or daysThe owning team, in working hours
DashboardUseful context, no action required on its ownWhoever is investigating

A useful habit: when someone proposes a new page, ask which of these it really is. Most proposals turn out to be tickets or dashboard panels.

4. SLO burn-rate alerting, simply

If a service has a service level objective, say 99.9% of requests succeed over 30 days, then it has an error budget: 0.1% of requests can fail in that window.

The burn rate is how fast you are spending that budget. A burn rate of 1 spends exactly the whole budget over the 30 days. A burn rate of 10 spends it in a tenth of the time, about three days.

Alerting on burn rate answers the question you actually care about: “if this continues, will we miss the objective, and how soon?”

A single window has trade-offs. A short window reacts quickly but is noisy. A long window is stable but slow to fire and slow to clear. The SRE workbook’s approach is multiwindow, multi-burn-rate:

  • Multi-burn-rate: a fast burn pages, a slow burn opens a ticket. The workbook’s starting point pages at a 14.4x burn over 1 hour (2% of a 30-day budget gone) and at 6x over 6 hours (5% gone), and tickets at 1x over 3 days (10% gone).
  • Multiwindow: each condition also checks a short window, typically 1/12 of the long one (5 minutes for the 1-hour rule). The alert fires only if both windows are burning. The short window means it stops firing soon after the problem is fixed, instead of staying red for an hour.

A sketch in Prometheus rule syntax, assuming a recorded error ratio per window:

- alert: ErrorBudgetFastBurn
  expr: |
    job:error_ratio:rate1h > (14.4 * 0.001)
    and
    job:error_ratio:rate5m > (14.4 * 0.001)
  labels:
    severity: page
  annotations:
    summary: "Error budget burning fast for {{ $labels.job }}"
    runbook_url: "https://runbooks.example.com/error-budget-burn"

Start with the workbook’s numbers and adjust once you have seen how they behave against your own traffic.

5. Thresholds, durations and flapping

For alerts that are not SLO-based, two settings do most of the work.

Threshold. Pick a value that means harm, not a value that looks high. If you don’t know what harms users, find that out before writing the alert.

Duration. In Prometheus, for: keeps an alert pending until the condition has held for the whole period. A short spike won’t page. The trade-off is detection time: a for: 10m adds up to ten minutes before anyone hears about it. Match the duration to how fast the harm grows.

- alert: HighRequestLatencyP99
  expr: histogram_quantile(0.99, sum by (le, job) (rate(http_request_duration_seconds_bucket[5m]))) > 0.5
  for: 10m
  labels:
    severity: page

Flapping is when an alert crosses its threshold back and forth, firing and resolving over and over. Ways to stop it:

  • Hysteresis: fire above one value, resolve only below a lower one. Prometheus has no built-in hysteresis, but you can approximate it by making the expression depend on whether the alert is already firing (via the ALERTS series), or by using a longer rate window.
  • Smoothing: alert on a rate or average over a window, not on a raw instantaneous value.
  • Keep-firing time: newer Prometheus versions support keep_firing_for: on a rule, which holds an alert firing for a period after the condition clears. Check that your version supports it.

6. Alert fatigue and pruning

When too many pages are noise, people learn to ignore pages. Then the real one gets ignored too. Fatigue is not a discipline problem; it is a design problem.

The fix is regular pruning:

  • Review every page. In a weekly on-call handover, go through each page that fired. For each one ask: was it actionable, urgent and real? What did the engineer actually do?
  • If nobody did anything, demote or delete it. Make it a ticket, move it to a dashboard, or remove it.
  • If the action was always the same mechanical step, automate it. A page that a script could answer should be answered by a script.
  • Track pages per shift. A rising count is a signal to prune before people burn out.

Deleting an alert feels risky. Keeping an alert nobody acts on is riskier, because it trains people to ignore the pager.

An alert that wakes someone should tell them where to start. Put the runbook link in the alert itself, as an annotation such as runbook_url, so it shows up in the notification.

If you can’t write a runbook for an alert, that is a strong hint it isn’t actionable. The previous post, Writing a runbook you can use at 3am, covers what goes in one.

A good notification also includes:

  • What is wrong, in user terms.
  • Which service, region or host.
  • The current value and the threshold.
  • A link to the relevant dashboard.

8. Routing, deduplication and grouping

Even good alerts become noise if they arrive badly.

  • Routing. Send each alert to the team that owns the thing, based on labels like team or service. Pages go to on-call; tickets go to a queue.
  • Deduplication. The same alert from two monitoring replicas should produce one notification, not two.
  • Grouping. When fifty hosts fail at once because one dependency broke, the on-call engineer needs one notification that says “fifty hosts”, not fifty notifications. Alertmanager’s group_by, group_wait and group_interval control this.
  • Inhibition. If a whole site is down, suppress the per-host alerts underneath it. The bigger alert already says what matters.
  • Silences. During planned maintenance, silence the expected alerts with an expiry time and a reason, so they come back on their own.

9. Examples for latency-sensitive hosts

On hosts where timing matters as much as uptime, the same rules apply, with a few specific signals.

Clock offset. If correct timestamps are a requirement, the clock is part of correctness. Alert on the absolute offset from the reference exceeding the tolerance you must meet, held for a short duration, and alert separately if the time sync daemon has lost all its sources. Offset beyond tolerance is urgent; a single source going away is usually a ticket. See Time sync on AWS: why microseconds of clock offset matter for how the offset is measured.

- alert: ClockOffsetBeyondTolerance
  expr: abs(node_timex_offset_seconds) > 0.0001
  for: 2m
  labels:
    severity: page

Set the threshold to your actual requirement, not to the value in this snippet.

Tail latency, not averages. An average hides the slow requests that hurt. Alert on p99 or p99.9 from a histogram, over a window long enough to have enough samples. A host can look healthy on mean latency while its tail is getting much worse.

Retries and timeouts. A rising retry rate is often the first sign of trouble downstream, before errors show up. It is usually a dashboard or ticket signal, and a page only when it threatens the SLO. Timeouts and retries without making outages worse covers why retry storms make outages bigger.

Host tuning drift. If a host’s tuned settings drift (CPU isolation, frequency governor, interrupt affinity), latency suffers before anything is down. That is a ticket from a drift check, not a page, unless latency is already breaching its objective. See Detecting configuration drift with Ansible check mode.

10. Checklist

Before an alert is allowed to page:

  • It is actionable, urgent and real.
  • It measures a symptom users feel, or a cause that reliably and quickly becomes one.
  • If there is an SLO, it uses burn rate with a long and a short window.
  • The threshold means harm, and the for: duration matches how fast harm grows.
  • It won’t flap: smoothing, hysteresis or keep-firing is in place.
  • It links to a runbook and a dashboard.
  • It routes to the owning team, and it groups and deduplicates.
  • Someone reviews it when it fires, and it is demoted or deleted if nobody acts.

11. Summary

  • A page is a request for a human to act now. Treat it as expensive.
  • Page on symptoms; use causes for diagnosis and tickets.
  • Burn-rate alerts tie paging to the objective users care about.
  • Tune thresholds and durations, and stop flapping.
  • Review every page and prune without guilt.
  • Every alert has a runbook, a clear owner and sensible grouping.

References

  1. Google SRE book, Monitoring Distributed Systems.
  2. Google SRE workbook, Alerting on SLOs.
  3. Rob Ewaschuk, My Philosophy on Alerting.
  4. Prometheus, Alerting best practices.
  5. Prometheus, Alerting rules.
  6. Prometheus, Alertmanager.