Lesson 7 of 9 · 25m
Alert Design: Symptoms, Causes, and the Cost of Being Wrong
How to write alerts that page humans only for human action, separate symptoms from causes, and use multiwindow burn rates without mysticism.
The purpose of alerting is not to detect everything. It is to interrupt a human only when that human can do something that automation cannot. Every bad alert imposes a tax: attention, trust, sleep, and eventually ignored real incidents. You do not get unlimited alerts; you get a small budget of credibility.
Page on symptoms, ticket on causes
# page-worthy symptom
- alert: CheckoutHighErrorRate
expr: |
sum by (service) (rate(http_requests_total{service="checkout",status=~"5.."}[5m]))
/
sum by (service) (rate(http_requests_total{service="checkout"}[5m]))
> 0.05
for: 10m
# cause-oriented diagnostic
- alert: DatabaseConnectionsNearLimit
expr: max by (database) (db_connections_active / db_connections_max) > 0.85
for: 30mThe first affects users. The second may explain it. Both can be useful, but they do not necessarily deserve the same severity or notification path. If the database is hot but checkout is healthy, waking a human may be premature; a ticket or investigation channel may be right.
Absence, staleness, and pipeline health
Some of the worst outages are monitoring outages. Alert on the ingestion path:
up{job="api"} == 0
time() - max by (job) (timestamp(up{job="api"})) > 300Be careful with absence alerts. absent() matching too broadly can fire because a label was renamed, not because production died. Anchor them to stable job or service labels and test what happens during deploys.
Burn rates beat instantaneous percentages
Error budget burn-rate alerting asks: "Are we consuming reliability too fast?" The practical implementation uses multiple windows:
- alert: CheckoutErrorBudgetBurnFast
expr: |
(
sum(rate(checkout_requests_total{status=~"5.."}[1h]))
/
sum(rate(checkout_requests_total[1h]))
) > (14.4 * 0.001)
and
(
sum(rate(checkout_requests_total{status=~"5.."}[5m]))
/
sum(rate(checkout_requests_total[5m]))
) > (14.4 * 0.001)
for: 2mThe long window prevents a one-minute blip from paging; the short window ensures the problem is happening now. Exact multipliers depend on the service-level objective. The important point is the structure: severity based on sustained impact, not one noisy sample.
for is not a magic stabilizer
for requires the expression to remain continuously true. Flapping around a threshold may never satisfy it, or may reset repeatedly. A better expression is often more important than a longer duration. Smoothing everything until the alert fires late is how monitoring becomes a postmortem timestamping system.
Every alert needs a response
An alert without a runbook step is just an anxiety delivery mechanism. Include annotations that answer: what is affected, how bad is it, where to look first, and what not to do.
annotations:
summary: "Checkout elevated 5xx rate"
runbook: "https://ops.sudosecurity.org/runbooks/checkout-errors"If the correct response is always "restart it," automate the restart or fix the software. Do not train humans to be cron jobs.
Field notes
- Review alert fatigue monthly: top firing alerts, repeated no-action alerts, and pages resolved as noise.
- Do not alert on every dependent symptom. One outage can generate fifty pages and destroy incident command clarity.
- Keep alert expressions close to service SLOs; machine-level detail belongs on diagnostic dashboards unless it independently threatens users.
- Test alerts by evaluating expressions against real historical incidents. If they would not have fired, they are decoration.
Was this lesson helpful?