Pidoku

Archive

This learning material is in the archive. It is not currently maintained and has not been updated with the latest information, so tool versions, prices and dates may be out of date.

Alerts That Deserve a Page

Module 3 Lesson 3.c 50 min Difficulty 3/5

Prerequisites 2.d, 3.a

The idea in one minute#

A page interrupts a person’s sleep, dinner or focus. Every page must therefore be urgent, important, actionable and real. If any of those is false, it should be a ticket, a dashboard, or nothing at all.

The rule that achieves this: page on symptoms, not causes. Users feel symptoms — errors, slowness, missing data — which SLO burn-rate alerts and black-box probes measure. Causes — high CPU, a full queue, one dead replica — are useful on dashboards and as tickets, but most of them never hurt a user. Then route alerts to the right people, group duplicates, suppress the consequences of a known failure, and review every page afterwards.

An analogy#

A smoke alarm that goes off every time you make toast gets its battery removed. Then, the night there is a real fire, it is silent. Alert fatigue is not an annoyance; it is how real alerts get missed.

A picture#

flowchart TB
  A["A condition you could alert on"] --> U{"Users hurt now,<br/>or soon?"}
  U -->|"no"| DASH["Dashboard<br/><small>or delete it</small>"]
  U -->|"yes"| ACT{"Human action<br/>needed?"}
  ACT -->|"no, automation fixes it"| AUTO["Automate<br/><small>log it, tell a channel</small>"]
  ACT -->|"yes"| URG{"Needs action<br/>within minutes?"}
  URG -->|"no, days"| TICKET[":jira: <b>Ticket</b>"]
  URG -->|"yes"| PAGE[":pagerduty: <b>Page</b><br/><small>with runbook + dashboard</small>"]
  class A neutral
  class U,ACT,URG queue
  class DASH,AUTO io
  class TICKET compute
  class PAGE warn

How it really works#

The four questions for every paging alert#

From Rob Ewaschuk’s My Philosophy on Alerting (the basis of the SRE book’s monitoring chapter):

  1. Does this detect a condition that is urgent, actionable and user-visible (or imminently so)?
  2. Will I ever be able to ignore it, knowing it is benign? Then it should not page.
  3. Does it definitely indicate users are being hurt, or can it fire when they are not?
  4. Can I take action? Is the action urgent, or could it wait until morning? Could it be automated?

Symptoms versus causes#

Symptom (page)Possible causes (dashboard / ticket)
Checkout error budget burning fastBad deploy, DB failover, payments provider down, pool exhausted
p99 latency SLO burningCPU saturation, GC pauses, slow query, noisy neighbour
Probe fails from 2 of 3 regionsDNS, certificate, LB, firewall
Orders not processed in 15 minutes (freshness)Queue consumer crashed, poison message, lag

One symptom alert covers all of its causes, including ones you have not imagined. A cause alert catches only that cause — and fires even when redundancy means users are fine.

Exceptions — some causes deserve a page because the symptom would arrive too late to fix:

  • Disk will be full in under 4 hours (predict_linear).
  • Certificate expires in under 3 days (a ticket weeks before should have caught it).
  • Replication to the DR site stopped (no symptom until the disaster).
  • Quorum lost on a consensus cluster (etcd, ZooKeeper) — one more failure is an outage.

Every page carries its context#

A paging alert must include, in the notification itself:

  • What is wrong, in user terms: “Checkout error budget burning at 20× (0.2% errors).”
  • Impact: which users, which region.
  • Runbook link (4.b) and dashboard link.
  • Since when and current value.

If the on-call engineer has to search for what the alert means, the alert is incomplete.

Routing, grouping, inhibition and silences#

Alertmanager (or PagerDuty, Opsgenie, incident.io, Grafana OnCall) does four jobs between the rule and the human:

YAML
# alertmanager.yml (excerpt)
route:
  receiver: default-slack
  group_by: [alertname, service]   # one notification per alert per service, not per pod
  group_wait: 30s                  # wait for related alerts before the first notification
  group_interval: 5m               # how often to send updates for the same group
  repeat_interval: 4h              # re-notify if still firing
  routes:
    - matchers: [severity="page", team="payments"]
      receiver: payments-pagerduty
    - matchers: [severity="ticket"]
      receiver: jira-tickets
      group_wait: 10m

inhibit_rules:
  # If a whole region is down, do not also page for every service in it.
  - source_matchers: [alertname="RegionDown"]
    target_matchers: [severity="page"]
    equal: [region]

receivers:
  - name: payments-pagerduty
    pagerduty_configs:
      - routing_key: <secret>
  - name: jira-tickets
    webhook_configs:
      - url: http://alert-to-jira.internal/hook
  - name: default-slack
    slack_configs:
      - channel: "#alerts"
        api_url: <secret>
MechanismPurpose
RoutingThe right team, the right severity, the right channel
Grouping200 pods failing produce one page, not 200
InhibitionA higher-level failure suppresses its consequences
SilencesPlanned maintenance or a known issue mutes matching alerts for a time — always with an expiry and a reason

Alert hygiene: measure the pager#

Track these monthly, per rotation:

MetricHealthy
Pages per on-call shift (12 h)≤ 2 incidents (Google’s target; one incident may be several pages)
Pages outside working hoursAs few as possible; each one reviewed
% of pages with action taken> 90%. A page where the answer was “it went away” is noise
% of pages that were duplicatesLow — fix grouping
Top 5 noisiest alertsReviewed and fixed or deleted every month

The most effective practice is a weekly alert review: every page from the last week, one line each — was it real, was it actionable, what changed as a result? An alert that was ignored twice gets fixed or deleted.

Anti-patterns#

  • CPU > 80% pages. Usually harmless; a symptom alert will fire if it is not.
  • Paging on a single instance failure behind a load balancer.
  • Flapping alerts that fire and resolve repeatedly — add hysteresis or a longer window.
  • Alerts with no owner routed to a shared channel nobody watches.
  • Email as a paging channel. It is not.
  • Silences without expiry. They outlive the reason and hide the next real problem.

A worked example#

A team’s pager last month: 61 pages, 38 outside working hours. Their review:

AlertPagesAction takenDecision
HighCPU on any node221Delete; covered by latency SLO burn
PodRestarted140Delete; dashboard only
CheckoutBudgetBurnFast44Keep
QueueDepth > 100093Replace with freshness SLO alert (orders older than 15 min)
DiskWillFillIn4h22Keep (cause exception)
ProbeFailed (any one region)101Require 2 of 3 regions

Projected pages next month: about 10, nearly all actionable. The program below performs this analysis from a log of pages.

Code#

Go
// pagereview.go — analyse a month of pages: noise ratio, off-hours load, worst offenders.
package main

import (
	"fmt"
	"sort"
	"time"
)

type page struct {
	alert  string
	at     time.Time
	action bool // did a human have to do something?
}

func main() {
	base := time.Date(2026, 10, 1, 0, 0, 0, 0, time.UTC)
	// A synthetic month: alert name, how often, what fraction needed action, hour of day pattern.
	type pattern struct {
		alert     string
		count     int
		actionPct float64
	}
	patterns := []pattern{
		{"HighCPU", 22, 0.05}, {"PodRestarted", 14, 0}, {"CheckoutBudgetBurnFast", 4, 1},
		{"QueueDepth>1000", 9, 0.33}, {"DiskWillFillIn4h", 2, 1}, {"ProbeFailed(1 region)", 10, 0.1},
	}
	var pages []page
	seed := 7
	for _, p := range patterns {
		for i := 0; i < p.count; i++ {
			seed = (seed*1103515245 + 12345) & 0x7fffffff
			at := base.Add(time.Duration(seed%(30*24*60)) * time.Minute)
			pages = append(pages, page{p.alert, at, float64(i) < p.actionPct*float64(p.count)})
		}
	}

	type stat struct {
		name                  string
		total, action, nights int
	}
	by := map[string]*stat{}
	var total, actioned, offHours int
	for _, p := range pages {
		s := by[p.alert]
		if s == nil {
			s = &stat{name: p.alert}
			by[p.alert] = s
		}
		s.total++
		total++
		h := p.at.Hour()
		wd := p.at.Weekday()
		off := h < 9 || h >= 18 || wd == time.Saturday || wd == time.Sunday
		if off {
			s.nights++
			offHours++
		}
		if p.action {
			s.action++
			actioned++
		}
	}
	list := make([]*stat, 0, len(by))
	for _, s := range by {
		list = append(list, s)
	}
	sort.Slice(list, func(i, j int) bool { return list[i].total-list[i].action > list[j].total-list[j].action })

	fmt.Printf("pages: %d   actionable: %.0f%%   off-hours: %.0f%%   per 12h shift: %.1f\n\n",
		total, 100*float64(actioned)/float64(total), 100*float64(offHours)/float64(total), float64(total)/60)
	fmt.Printf("%-24s %6s %8s %10s  %s\n", "alert", "pages", "action%", "off-hours", "verdict")
	for _, s := range list {
		pct := 100 * float64(s.action) / float64(s.total)
		verdict := "keep"
		switch {
		case pct < 20:
			verdict = "delete or demote to dashboard"
		case pct < 80:
			verdict = "rewrite as a symptom / SLO alert"
		}
		fmt.Printf("%-24s %6d %7.0f%% %10d  %s\n", s.name, s.total, pct, s.nights, verdict)
	}
}

Remember this#

  • A page must be urgent, important, actionable and real. Everything else is a ticket or a dashboard.
  • Page on symptoms (SLO burn, probes); keep causes for dashboards — except the few that would arrive too late (disk filling, DR replication stopped, quorum lost).
  • Every page carries impact, a runbook link and a dashboard link.
  • Route, group, inhibit; silence only with an expiry.
  • Review every page weekly. Target ≤ 2 incidents per 12-hour shift and > 90% actionable.

Try it#

  1. Run pagereview.go. Change HighCPU to 60 pages. What happens to the per-shift number?
  2. Export last month’s pages from your paging tool and run the same analysis.
  3. Write the Alertmanager inhibition rule that stops per-service pages when the database cluster is down.

Check yourself#

  1. Why does one symptom alert beat many cause alerts?
  2. Name two cause alerts that are worth paging for, and why.
  3. What is the difference between grouping and inhibition?
  4. A page fired and resolved before anyone looked. What should the alert review decide?

Sources#

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in