Alerting on Symptoms
A page wakes a person up. It should happen only when users are being hurt, or soon will be, and when a human needs to act now. Everything else is a ticket, a dashboard or nothing. Observability teaches how to write alert rules; this lesson is about which alerts deserve to exist.
Symptoms, not causes
| Cause-based alert | Symptom-based alternative |
|---|---|
| CPU above 90% on a node | checkout latency SLO burning fast |
| a pod restarted | error ratio for users above the burn threshold |
| disk 80% full | ticket: disk will be full in 4 days at the current rate (predict_linear) |
| replication lag above 10 s | freshness SLI of the reports page below target |
| one of 20 instances down | (no page: the load balancer routes around it; show it on a dashboard) |
Causes are still useful: they belong on dashboards and in runbooks, to diagnose a symptom once it has paged. A few cause-based alerts survive because they predict a symptom too late to react otherwise (a certificate expiring in 7 days, a disk filling up): route them as tickets.
Four properties of an alert
The SRE workbook judges an alerting rule by four properties:
| Property | Meaning | Hurt by |
|---|---|---|
| precision | share of alerts that were about a real, significant event | thresholds close to normal noise, short windows |
| recall | share of significant events that triggered an alert | thresholds too high, windows too long |
| detection time | how long after the problem starts the alert fires | long windows, long for: durations |
| reset time | how long the alert keeps firing after the problem is fixed | long windows |
These pull against each other. The model shows the trade-off on a week of synthetic per-minute traffic for a 99.9% SLO: normal noise, a few harmless two-minute blips, and one real incident (2% errors for 60 minutes). It counts the pages each rule sends:
import math
import random
rng = random.Random(3)
MIN = 7 * 24 * 60
REQ = 1000 # requests per minute
INCIDENT = range(4000, 4060) # minutes with 2% errors
BLIPS = {1500, 1501, 6200, 6201, 8800, 8801} # 1% errors for two minutes
def poisson(mean): # errors in one minute (Knuth's method)
limit, k, p = math.exp(-mean), 0, rng.random()
while p > limit:
k += 1
p *= rng.random()
return k
errors = []
for m in range(MIN):
p = 0.02 if m in INCIDENT else 0.01 if m in BLIPS else 0.0004
errors.append(poisson(p * REQ))
def evaluate(name, window, threshold):
starts, firing, first, reset, total = [], False, None, None, 0
for m in range(MIN):
total += errors[m] - (errors[m - window] if m >= window else 0)
now = total / (REQ * min(m + 1, window)) > threshold
if now and not firing:
starts.append(m)
if now and first is None and m >= INCIDENT[0]:
first = m
if not now and firing and m > INCIDENT[-1] and reset is None:
reset = m - INCIDENT[-1] - 1
firing = now
false = sum(1 for s in starts if s not in INCIDENT)
detect = "never" if first is None or first > INCIDENT[-1] else f"{first - INCIDENT[0]:>2} min"
reset = "n/a" if reset is None or first is None else f"{reset:>2} min"
print(f"{name:<34} pages {len(starts):>3} false {false:>3} detect {detect:>6} reset {reset:>6}")
evaluate("1 min window > 0.1% (SLO)", 1, 0.001)
evaluate("10 min window > 0.1% (SLO)", 10, 0.001)
evaluate("1 h window > 1.44% (14.4x budget)", 60, 0.0144)
evaluate("6 h window > 1.44%", 360, 0.0144)1 min window > 0.1% (SLO) pages 610 false 609 detect 0 min reset 0 min
10 min window > 0.1% (SLO) pages 16 false 15 detect 0 min reset 9 min
1 h window > 1.44% (14.4x budget) pages 1 false 0 detect 43 min reset 14 min
6 h window > 1.44% pages 0 false 0 detect never reset n/a
Alerting whenever the SLO is missed over a short window has perfect recall and fast detection, but sends pages for every blip and every noisy minute: hundreds of pages a week that people learn to ignore. The 1-hour window with a high threshold sends exactly one page, but only 43 minutes into the incident, and keeps firing for 14 minutes after the fix. Make the window too long and the incident never crosses the line at all. The next two lessons build the rule that gets all four properties right: burn rate over several windows.
Pages, tickets and nothing
| Route | When | Example |
|---|---|---|
| page | users hurt now or within hours; a human must act now | fast budget burn on checkout |
| ticket | needs action within days | slow budget burn; certificate expires in 7 days |
| dashboard / log | useful for diagnosis, no action needed | node CPU, pod restarts |
Every page should be actionable (the responder can do something), urgent and novel (not the same known issue for the tenth time). Review the paging alerts of the past month in the team's weekly meeting and delete or demote the ones that fail these tests.
Test yourself
Which alert is symptom-based?
- Node CPU above 90%
- Checkout error budget burning 14x faster than sustainable
- Pod restarted
- Disk 80% full
In the model, what happened to the 6-hour window with the 1.44% threshold?
- It paged constantly
- It never fired, because averaging over 6 hours diluted the 60-minute incident below the threshold
- It detected the incident in one minute
- It had the most false pages
What is 'reset time'?
- Time to restart a pod
- How long an alert keeps firing after the problem is fixed
- Time between pages
- Time to acknowledge