StackPractices
intermediate By Mathias Paulenko

Alert Runbook Template: From Page to Postmortem

A standardized runbook for responding to alerts: triage, diagnosis, mitigation, resolution, and post-incident steps with escalation paths.

Overview

An alert runbook gives on-call engineers a structured playbook for responding to a specific alert. Without a runbook, engineers waste time figuring out what the alert means, where to look, and what to do. This template standardizes incident response: triage, diagnose, mitigate, resolve, and document.

For severity design and escalation policies, the alert management guide complements this template. After the incident, document it with the incident postmortem template.

Mermaid flowchart LR diagram

When to Use

Use this template when:

  • Creating runbooks for the top 20 most frequent or critical alerts
  • Onboarding new on-call engineers
  • Standardizing incident response across teams
  • SRE maturity improvement initiatives
  • Compliance requirements for documented incident procedures

You don’t need it for alerts nobody pages on — a dashboard-only P5 metric doesn’t deserve a runbook, and neither does an alert with a single obvious action. The template pays off when diagnosis branches and the wrong first guess costs minutes.

Solution

# Alert Runbook: `<Alert Name>`

## Alert Metadata

| Field | Value |
|-------|-------|
| Alert Name | HighErrorRate-PaymentService |
| Severity | Critical (P1) |
| Alert Source | Prometheus / Alertmanager |
| Alert Query | `rate(http_requests_total{service="payment",status=~"5.."}[5m]) / rate(http_requests_total{service="payment"}[5m]) > 0.05` |
| Trigger Condition | Error rate > 5% for 5 minutes |
| Routing | PagerDuty → Payment Team On-Call |
| Runbook Owner | Payment Team |
| Last Reviewed | 2026-07-05 |
| Last Updated | 2026-07-05 |

## Impact Assessment

| User Impact | Business Impact |
|-------------|-----------------|
| Users can't complete payments | Revenue loss ~$2,000/min during peak |
| Checkout page shows error message | Customer support tickets increase |
| Retry attempts may succeed for transient errors | Reputation damage if prolonged |

## Triage (0-2 minutes)

### Step 1: Acknowledge the Alert

- [ ] Acknowledge in PagerDuty within 2 minutes
- [ ] Post in `#payment-incidents` Slack channel: "Investigating HighErrorRate-PaymentService"
- [ ] Check if this is a known false positive (check recent alert history)

### Step 2: Assess Severity

| Question | If Yes |
|----------|--------|
| Is error rate > 20%? | Escalate to P0, page secondary on-call |
| Is this during peak hours (9-18 UTC)? | Higher priority, revenue impact is greater |
| Are there related alerts firing? | Check for cascade — may be a shared dependency |
| Is this a new deployment? | Check #deployments channel for recent release |
| Is this a known maintenance window? | Check #maintenance channel |

### Step 3: Quick Checks

| Check | How | Expected |
|-------|-----|----------|
| Service health | `curl https://api.example.com/health` | 200 OK |
| Recent deployment | Check `#deployments` channel | Last deploy > 30 min ago |
| Database connectivity | Check Grafana → Payment DB panel | Connections < 80% pool |
| Payment provider status | Check https://status.stripe.com | All systems operational |
| Error logs | `kubectl logs -l app=payment --tail=100` | Look for repeated error patterns |

## Diagnosis (2-15 minutes)

### Step 4: Identify Error Type

Check the Grafana dashboard for the payment service: [Payment Service Dashboard](https://grafana.example.com/d/payment-service)

| Error Pattern | Likely Cause | Next Step |
|---------------|-------------|-----------|
| 500 Internal Server Error | Application bug or unhandled exception | Go to Step 5A |
| 502 Bad Gateway | Service is down or not responding | Go to Step 5B |
| 503 Service Unavailable | Pod crashes or OOM kills | Go to Step 5C |
| 504 Gateway Timeout | Database slowness or external API timeout | Go to Step 5D |
| 429 Too Many Requests | Rate limiting from payment provider | Go to Step 5E |

### Step 5A: Application Bug (500 Errors)

1. Check error logs for stack traces:
   ```bash
   kubectl logs -l app=payment --tail=200 | grep -A 20 "Error\|Exception\|stack"
  1. Search for the error in Sentry: Sentry Payment Project
  2. Check if a new code deployment introduced the bug:
    kubectl rollout history deployment/payment
  3. If new deployment caused the error, roll back:
    kubectl rollout undo deployment/payment
  4. Verify error rate drops after rollback

Step 5B: Service Down (502 Errors)

  1. Check pod status:
    kubectl get pods -l app=payment -o wide
  2. Check pod events:
    kubectl describe pod <pod-name> | tail -30
  3. Check if pods are crashing:
    kubectl get events --field-selector reason=BackOff --sort-by=.lastTimestamp | tail -10
  4. If pods are crashing, check crash logs:
    kubectl logs <pod-name> --previous
  5. If all pods are down, restart the deployment:
    kubectl rollout restart deployment/payment
  6. Monitor pod startup and health check

Step 5C: OOM Kills (503 Errors)

  1. Check for OOM kills:
    kubectl get pods -l app=payment -o jsonpath="{.items[*].status.containerStatuses[0].lastState.terminated.reason}"
  2. If OOMKilled, check memory usage in Grafana: Pod Memory Dashboard
  3. Check for memory leak in application:
    kubectl top pods -l app=payment --sort-by=memory
  4. Temporary fix: increase memory limit:
    kubectl patch deployment payment -p '{"spec":{"template":{"spec":{"containers":[{"name":"payment","resources":{"limits":{"memory":"1Gi"}}}]}}}}'
  5. Long-term fix: investigate memory leak, file a bug

Step 5D: Database Timeout (504 Errors)

  1. Check database connection pool:
    kubectl exec -it <payment-pod> -- node -e "console.log(require('./db').pool.stats())"
  2. Check slow queries in database:
    SELECT query, mean_exec_time, calls
    FROM pg_stat_statements
    ORDER BY mean_exec_time DESC
    LIMIT 10;
  3. Check database CPU and IOPS in Grafana: Database Dashboard
  4. If database is overloaded, check for long-running transactions:
    SELECT pid, now() - xact_start AS duration, query, state
    FROM pg_stat_activity
    WHERE state IN ('active', 'idle in transaction')
    ORDER BY duration DESC;
  5. Kill long-running queries if blocking:
    SELECT pg_terminate_backend(<pid>);

Step 5E: Rate Limiting (429 Errors)

  1. Check Stripe API dashboard for rate limit warnings: Stripe Dashboard
  2. Check if request volume spiked:
    kubectl logs -l app=payment --tail=500 | grep "stripe.com" | wc -l
  3. Enable request batching if available
  4. Implement client-side rate limiting:
    // Add rate limiter middleware
    const rateLimiter = new RateLimiter({ maxRequests: 90, perSeconds: 1 });
  5. If Stripe is the bottleneck, consider using Stripe’s idempotency keys to retry safely

Mitigation (5-30 minutes)

Quick Mitigation Options

OptionWhen to UseImpactReversibility
Roll back deploymentNew deploy caused errorsLoses new featuresEasy — redeploy
Scale up podsHigh traffic overwhelming serviceHigher costEasy — scale down
Enable circuit breakerExternal API is downDegrades gracefullyEasy — flip flag
Enable fallback modeDatabase is slowRead-only modeEasy — flip flag
Rate limit usersProtecting from DDoSSome users blockedEasy — remove limit
Disable problematic endpointOne endpoint causing cascadeFeature unavailableEasy — re-enable

Rollback Procedure

# 1. List recent revisions
kubectl rollout history deployment/payment

# 2. Roll back to previous version
kubectl rollout undo deployment/payment

# 3. Monitor rollout status
kubectl rollout status deployment/payment --timeout=120s

# 4. Verify error rate drops
# Check Grafana: https://grafana.example.com/d/payment-service
# Wait 5 minutes for error rate to normalize

Escalation

LevelWhoWhen to Escalate
1On-call engineerAlert received
2Secondary on-callNo progress after 15 minutes
3Team lead + SRENo progress after 30 minutes
4Engineering managerIncident > 1 hour or revenue impact > $10k
5CTO + VP EngineeringIncident > 4 hours or public impact

Escalation Contacts

RolePrimarySecondary
Payment Team On-CallPagerDuty: payment-primaryPagerDuty: payment-secondary
SRE On-CallPagerDuty: sre-primarySlack: @sre-oncall
Database AdminSlack: @dba-teamPagerDuty: dba-primary
Engineering ManagerSlack: @eng-managerPhone: x1234

Resolution

Step 6: Verify Resolution

  • Error rate below 1% for 10 consecutive minutes
  • No new error alerts firing
  • Payment success rate back to normal (> 99%)
  • No user complaints in #support channel
  • All pods healthy and stable

Step 7: Document

  • Update incident in PagerDuty with resolution summary
  • Post resolution in #payment-incidents: “Resolved: HighErrorRate-PaymentService — ”
  • Create postmortem document if P1 (within 48 hours)
  • File follow-up tickets for root cause fix
  • Update this runbook with any new learnings

Post-Incident

Postmortem Required?

SeverityPostmortem RequiredDue Date
P0Yes, blameless postmortemWithin 48 hours
P1Yes, blameless postmortemWithin 48 hours
P2Optional, if recurringWithin 1 week
P3NoN/A

Follow-Up Actions

ActionOwnerDue DateStatus
Fix root cause
Add monitoring for root cause
Update runbook with new learnings
Add test to prevent regression

## Writing Your First Runbook

If your team has zero runbooks today, the path that works is small and specific. Pick the alert that paged most often last quarter — not the scariest one, the most frequent one, because frequency is where the template pays back fastest. Pull the last three or four incidents it produced and read them: the diagnosis branches of your runbook are already written inside those tickets, in the order people actually took them.

Draft the runbook with the person who answered those pages — the steps they skipped matter as much as the steps they took. Then run it once against a controlled failure before trusting it: a game day in staging, or even a quiet hour where someone follows the steps against production metrics without injecting a fault. Publish it in the same repo as the alert rule, wire `runbook_url` into the annotation, and only then move to the second alert. Ten runbooks built this way beat fifty written from theory.

Ownership is the piece teams get wrong here: the team that carries the pager owns the runbook, full stop. A platform team can provide the template and the review, but the people who get paged are the only ones who know whether step 5B still matches reality.

Review runbook PRs like code PRs, with one extra question: "did a human follow this?" A runbook step that looks right but was never executed is the most dangerous line in the document — it reads with authority and fails quietly. Ask in review which steps were actually run and on which system; a step that can't name its test environment should say so honestly instead of pretending to be verified.

## Explanation

A runbook serves two audiences: the experienced on-call engineer who needs a quick reference, and the new on-call engineer who needs step-by-step guidance. The triage section is for quick assessment — can this be resolved in 2 minutes or does it need deeper investigation? The diagnosis section branches by error type, so the engineer doesn't waste time checking irrelevant things.

The mitigation section focuses on stopping the bleeding. The goal isn't to fix the root cause but to restore service. Rollback, scale up, or enable fallback modes are valid mitigations. Root cause analysis happens post-incident.

The escalation matrix removes ambiguity about when to ask for help. "When in doubt, escalate" should be the culture, but having explicit time-based triggers prevents engineers from struggling alone for too long.

The resolution and post-incident sections ensure the incident is properly closed and learnings are captured. Every P1 incident should produce a postmortem and at least one follow-up action item.

One structural choice worth understanding: the diagnosis section is a decision tree, not a checklist. Triage is linear — acknowledge, assess, quick checks — because it runs under time pressure with nothing known yet. Diagnosis branches because the cost of a wrong path is real time. When you adapt the template, keep that split: linear where speed matters and uncertainty is high, branching where the answer changes what you do next.

## Prioritizing Which Alerts Get Runbooks

If you've got sixty paging alerts and zero runbooks, writing them all at once fails — the runbooks decay faster than you can produce them. Prioritize by three signals:

1. **Frequency**: the alert that pages weekly earns its runbook before the alert that pages yearly. Check your incident history for the last 90 days.
2. **Severity**: P1 and P2 first, because those are the pages where a wrong first step costs the most.
3. **Ambiguity**: an alert whose resolution is one obvious command doesn't need a playbook. The ones that do are alerts with two or three plausible causes — "HighErrorRate" could be a deploy, a database, or a third party, and that's exactly where a decision tree pays.

Score each alert on the three, write the top ten, and stop. A library of ten good runbooks that get maintained beats sixty that were written once and never tested — and the review cadence from the earlier section only stays realistic while the library is small enough to actually re-read.

## How to Adapt the Template

Copy the template and fill it in for one specific alert — not "errors in general," but `HighErrorRate-PaymentService`. The steps that change most between alerts:

**Metadata and impact.** The alert query and trigger condition come straight from your alerting rules — copy them verbatim so the responder can confirm they're looking at the right alert. Fill the impact table from actual numbers, even rough ones: "$2,000/min during peak" changes escalation decisions; "users may be affected" changes nothing.

**Triage questions.** Rewrite Step 2's questions around what flips severity for *this* alert. The pattern to keep: each question has a concrete "if yes" action, not a judgment call. If the answer is "it depends," the question doesn't belong in triage.

**Diagnosis branches.** Step 4's error-pattern table is the heart of the runbook. List the 3-6 failure modes this alert actually sees — check your incident history for the last year and use what really happened, not what could theoretically happen. Each branch should end in a different action; if two rows lead to the same step, merge them.

**Mitigation table.** Only include options your stack actually supports — if you don't have feature flags, "flip flag" isn't an option. Keep the reversibility column: at 3am "easy to undo" beats "perfect fix."

**Escalation.** Replace the example contacts with your real PagerDuty services and Slack handles, then delete rows that don't apply — a five-level chain makes sense for a payment service, not for an internal dashboard.

**Post-incident.** The follow-up actions table is the part most teams skip, and it's the reason incidents repeat. Keep it mandatory for P1/P2 even if it's three empty rows.

## Keeping Runbooks Alive

A runbook that lies is worse than no runbook — the responder follows a dead link, loses five minutes, and stops trusting the rest of the document. Three habits keep them honest:

- **Link from the alert.** Put `runbook_url` in the alert annotation so the page arrives with the playbook attached. If responders have to search, half of them won't.
- **Review on a schedule and on events.** Quarterly for everything, immediately after every incident that used the runbook. The incident review question is simple: which step was wrong or missing?
- **Test under pressure.** Game days exist for this — walk a new responder through the runbook against a real (staging) failure and watch where they stall. A runbook that only reads well was written, not tested.

One last discoverability rule: keep the mapping one-to-one and name files after the alert. `runbooks/HighErrorRate-PaymentService.md` is findable; `runbooks/database-issues.md` is a graveyard of half-relevant notes. When a responder lands from a page, the filename should be the alert name they just saw — anything else adds a search step at the worst possible moment.

Track freshness as a metric: percentage of runbooks reviewed in the last 90 days. Teams that publish the number keep it high; teams that don't find out their runbooks are stale at the worst possible time.

And close the loop back into alerting: when a postmortem finds the runbook's diagnosis branches in the wrong order — responders kept hitting the real cause in branch 5D while starting at 5A — that's signal for the alert itself, not just the doc. Reorder the runbook, but also ask whether the alert should carry the discriminator (a label, an annotation, a second alert) so branch selection happens before the page, not inside it.

## Runbook Quality Checklist

Before a runbook counts as done, it should pass this review:

- [ ] Alert name and query copied verbatim from the alerting rules
- [ ] Impact stated in numbers (revenue, users, SLA), not adjectives
- [ ] Triage questions all have a concrete "if yes" action
- [ ] Each diagnosis branch ends in a different next step
- [ ] Every command was copy-pasted and run, not typed from memory
- [ ] Mitigation options limited to what the stack actually supports
- [ ] Escalation contacts are real and current
- [ ] Runbook URL is in the alert annotation
- [ ] A second responder walked through it once — ideally on a game day

## Runbooks, Playbooks and SOPs

The terms get used interchangeably and they shouldn't be. A **runbook** answers "this alert just fired — what do I do?": narrow, imperative, tied to a trigger. A **playbook** answers "this class of incident is happening — what's our strategy?": broader, covers communication, roles and decision points, not just commands. An **SOP** (standard operating procedure) answers "how do we perform this recurring task correctly?": deployments, certificate renewals, capacity changes — proactive work, not reactive response.

The distinction matters because the documents get written differently. A runbook that drifts into playbook territory gets too long to use at 3am; an SOP dressed as a runbook has no trigger and never gets found when it should. Keep them separate and cross-link them — the runbook for a database alert can reference the failover SOP without duplicating it.

## Measuring Runbook Effectiveness

A runbook library that isn't measured is a pile of hope. Four numbers tell you whether it's working:

- **Coverage**: percentage of P1/P2 alerts that have a runbook. Target 100% for paging alerts — anything less means someone's first response to a critical alert is improvisation.
- **Usage**: how often the runbook is actually opened during incidents. If it's linked in the alert annotation this is a tracking-pixel problem, not a survey. Low usage usually means the runbook isn't linked where the alert lands.
- **Resolution delta**: MTTR for incidents that used the runbook vs ones that didn't. This is the number that justifies the maintenance time — teams that measure it typically see the runbook path resolve faster.
- **Freshness**: percentage reviewed in the last 90 days. The cheapest metric to track and the best predictor of the other three — a stale runbook fails all of them.

Review the four together quarterly. Coverage without usage means linking is broken; usage without a resolution delta means the runbooks themselves need work.

## Variants

- **Database alert**: add query analysis and index checks, and include DBA in the escalation chain — the diagnosis branches become slow-query, lock contention, and connection-pool exhaustion.
- **Infrastructure alert**: add Terraform state and networking checks; mitigation options shift toward failover and capacity rather than rollback.
- **Security alert**: add containment and forensics steps before any mitigation — evidence preservation changes the order of operations, and the runbook should follow your security incident response plan instead.
- **Third-party outage**: diagnosis is short (check the vendor status page, verify with a synthetic request) and the runbook is mostly mitigation — fallback mode, circuit breaker, queue-and-retry.
- **Scheduled maintenance**: a pre-maintenance checklist variant — suppress the expected alerts with an expiry date, list the rollback plan before you start, and define the verification steps that end the window.

## The Notification That Carries the Runbook

The runbook starts working before anyone opens it — inside the alert notification itself. A page that arrives as bare text ("HighErrorRate firing") makes the responder reconstruct context; a page that arrives with the severity, the first two triage questions, and the runbook link already attached is the first step of the playbook.

Two implementation details make the difference. In Prometheus, put the link in `annotations.runbook_url` — every downstream tool (Alertmanager, PagerDuty, Slack) carries it through. And put the triage-critical fields (`severity`, `service`, `environment`) in `labels`, because routing and inhibition match on labels, not annotations. Notification content that only lives in an annotation can't drive routing decisions.

## What Works

1. Keep runbooks next to the alert — link the runbook URL in the alert annotation
2. Test runbooks during game days — verify steps work under pressure
3. Update runbooks after every incident — add new learnings while they're fresh
4. Include screenshots and direct links — reduce navigation time during incidents
5. Use checkboxes — engineers can track progress under stress
6. Include time estimates for each section — set expectations for resolution time
7. Keep commands copy-pasteable — no one types kubectl commands from memory at 3 AM

## Common Mistakes

1. Generic runbooks — "check the logs" isn't actionable. Specify which logs, which query, which dashboard.
2. No escalation criteria — engineers struggle alone instead of asking for help.
3. Outdated runbooks — service names, dashboard URLs, and commands change. Review quarterly.
4. No mitigation options — runbooks that only describe diagnosis without mitigation leave engineers stuck.
5. Too much background — keep context minimal. The engineer needs action steps, not a history lesson.
6. No post-incident steps — incidents without postmortems repeat.
7. Runbooks not linked from alerts — engineers have to search for the runbook instead of clicking a link.
8. One runbook for many alerts — a runbook that tries to cover "any 5xx" ends up vague enough to be useless for all of them. One alert, one runbook.
9. Steps nobody verified — "restart the service" written by someone who never restarted it in production usually hides a prerequisite. Every step in the final document should have been executed at least once, by someone, on a real system.

## FAQ

The questions below come up every time a team adopts the template — most are about scope, depth, or keeping the library alive.

### How many runbooks do we need?

Start with the top 20 alerts by frequency or severity. Cover all P1 and P2 alerts first. Add runbooks for new alerts as they fire. If an alert fires more than 3 times without a runbook, create one.

### How detailed should each step be?

Detailed enough that a new team member can follow it. Include exact commands, URLs, and expected outputs. If a step requires judgment ("check if the database is slow"), specify what "slow" means (e.g., "p95 query latency > 1 second").

### Should runbooks be in code or a wiki?

In code, next to the alerting rules. Version-controlled runbooks track changes over time and can be reviewed in PRs. Wiki runbooks go stale because no one owns them. Use markdown files in the same repository as your infrastructure code.

### What if the runbook doesn't help?

If the runbook doesn't resolve the issue, escalate. After the incident, update the runbook with the new diagnosis and mitigation steps. A runbook that didn't help is a learning opportunity, not a failure.

### How often should runbooks be reviewed?

Quarterly at minimum. After every incident, review the relevant runbook and update it with any new learnings. During game days, test runbooks and update steps that don't work. Track runbook freshness as a metric: percentage of runbooks reviewed in the last 90 days.

### Who should write the runbook — the person who built the service or the one who answers the page?

The responder writes it, ideally with the service owner in review. The person who built the system knows the architecture but writes steps for their own context — the person who gets paged writes for 3am eyes. When they're the same person, get a second responder to walk the steps once before publishing.

### What about alerts that usually resolve themselves?

Either delete the alert or keep the runbook short. If the alert self-heals most of the time but occasionally signals something real, the runbook's job is distinguishing the two fast — the triage section carries all the weight. If it always self-heals, you're documenting noise; the fix is deleting or downgrading the alert, not documenting it.

**Companion files:** the [alert-runbook-template companion repo](https://mathiaspaulenko.github.io/stack-practices-resources/resources/docs/observability/alert-runbook-template/) has the template above as a blank fillable file plus the filled `HighErrorRate-PaymentService` example — ready to copy next to your alerting rules.

## Further Reading

- [Google SRE Book — Dealing with Interrupts](https://sre.google/sre-book/dealing-with-interrupts/) — the canonical on-call and runbook chapter
- [PagerDuty — Incident Response](https://www.pagerduty.com/resources/learn/incident-response/) — escalation design

Frequently Asked Questions

How many runbooks do we need?

Start with the top 20 alerts by frequency or severity. Cover all P1 and P2 alerts first. Add runbooks for new alerts as they fire. If an alert fires more than 3 times without a runbook, create one.

How detailed should each step be?

Detailed enough that a new team member can follow it. Include exact commands, URLs, and expected outputs. If a step requires judgment ("check if the database is slow"), specify what "slow" means (e.g., "p95 query latency > 1 second").

Should runbooks be in code or a wiki?

In code, next to the alerting rules. Version-controlled runbooks track changes over time and can be reviewed in PRs. Wiki runbooks go stale because no one owns them. Use markdown files in the same repository as your infrastructure code.

What if the runbook doesn't help?

If the runbook doesn't resolve the issue, escalate. After the incident, update the runbook with the new diagnosis and mitigation steps. A runbook that didn't help is a learning opportunity, not a failure.

How often should runbooks be reviewed?

Quarterly at minimum. After every incident, review the relevant runbook and update it with any new learnings. During game days, test runbooks and update steps that don't work. Track runbook freshness as a metric: percentage of runbooks reviewed in the last 90 days.

Who should write the runbook — the person who built the service or the one who answers the page?

The responder writes it, ideally with the service owner in review. The person who built the system knows the architecture but writes steps for their own context — the person who gets paged writes for 3am eyes. When they're the same person, get a second responder to walk the steps once before publishing.

What about alerts that usually resolve themselves?

Either delete the alert or keep the runbook short. If the alert self-heals most of the time but occasionally signals something real, the runbook's job is distinguishing the two fast — the triage section carries all the weight. If it always self-heals, you're documenting noise; the fix is deleting or downgrading the alert, not documenting it.

Companion files: the alert-runbook-template companion repo has the template above as a blank fillable file plus the filled HighErrorRate-PaymentService example — ready to copy next to your alerting rules.