Rana Maninder Singh
Lesson 10 of 12DevOps & Platform Engineering

Reliability Engineering & Incident Management

Lesson opener

In one line: Define reliability through measurable error budgets, manage it through a structured incident command that traces every decision to a named human, and improve it through blameless post-incident reviews that close the loop back to the pipeline.

Why it matters: Reliability is not a default state—it is engineered, measured, and defended. Without error budgets, reliability competes with features and loses. Without incident command, responders talk over each other, actions go uncoordinated, and communication reaches the wrong people. Without blameless PIR, teams fix symptoms and repeat the incident.

Before this lesson: Source Control & Collaboration through Security in the Pipeline, and Observability: Metrics, Logs, Traces & Alerts.

Cross-domain references: Cloud Security for Data & AI, Security Architecture & Governance, Scalability, Reliability & Resilience, Security Architecture & Governance (SAD), Architecture Communication & Decision Making, LLMOps: Production Deployment & Reliability, LLMOps: Governance, Operations & Incident Response.

What you will be able to do

Deliverable: an incident management playbook for the Northline order-processing service: severity table with response times, role assignments, the four-phase incident timeline with decision points, a backup/restore strategy with tested RTO/RPO, and a PIR template with CAPA fields.

Prerequisites

PrerequisiteWhy it matters here
Observability: Metrics, Logs, Traces & AlertsSLOs, burn rates, and runbooks are the inputs to incident detection and diagnosis.
Deployment StrategiesRollback and traffic-shift mechanisms are the primary containment tools.
Infrastructure as CodeIdempotent IaC playbooks are the recovery mechanism for infrastructure failures.
Kubernetes & Managed RuntimesCluster-level failure modes and recovery primitives (pod eviction, node drain, cluster autoscaler).
Scalability, Reliability & ResilienceArchitectural patterns (circuit breaker, bulkhead, retry) that prevent cascading failures.
LLMOps: Production Deployment & ReliabilityParallel reliability patterns for ML inference services.
LLMOps: Governance, Operations & Incident ResponseGovernance and PIR patterns for AI-assisted platforms.

Plain English

Reliability and availability

Availability is the proportion of time a system is operational and serving requests correctly, measured over a defined window. It is commonly expressed as a percentage: 99.9 % means the system is unavailable for at most 8.77 hours per year, 99.95 % for 4.38 hours, 99.99 % for 52.6 minutes.

Reliability is a broader concept: the probability that a system performs its required function under stated conditions for a specified period. A system can be highly available (up 99.9 % of the time) but unreliable if the "up" time includes silent wrong answers, degraded performance, or partial failures. Observability makes the difference between the two detectable.

Key operational metrics:

MetricWhat it measuresFormula
MTBF (Mean Time Between Failures)Average time between the end of one incident and the start of the nextTotal uptime / number of failures
MTTR (Mean Time To Restore)Average time from incident start to full service restorationTotal incident duration / number of incidents
MTTD (Mean Time To Detect)Average time from failure start to alert firingDepends on alerting configuration
MTTC (Mean Time To Contain)Average time from detection to containment actionRollback, traffic shift, or kill switch activated

MTTR is the most operationally actionable metric. Reducing MTTR—through better runbooks, faster rollback, clearer ownership, and practiced response—has more immediate impact on availability than preventing every failure.

Error budgets and the reliability-feature balance

An error budget (introduced in Observability: Metrics, Logs, Traces & Alerts) is the complement of the SLO. At 99.5 %, the 30-day budget is 0.5 %, equivalent to approximately 216 minutes of full unavailability.

The error budget is a shared resource between planned risk (feature releases, infrastructure changes) and unplanned failures. Error-budget policy translates the budget level into organisational decisions:

Budget remainingPolicy
> 50 %Normal release cadence.
25–50 %Extra review for high-risk changes; one reliability initiative per sprint.
< 25 %All non-critical feature releases paused; reliability work is the team's first priority.
Exhausted (≤ 0 %)Feature freeze until the window rolls forward with the budget restored. Emergency reliability work only.

The budget makes the reliability–feature trade-off an engineering conversation with numbers, not a political one. It is the team's budget to spend; it is also the signal that spending has gone too far.

Severity model

A severity model defines the urgency, response time, escalation path, and communications requirement for each class of incident. Every incident must be assigned a severity level within the first five minutes of triage.

SeverityTypical criteriaResponse targetEscalation
SEV1 (Critical)Complete service outage; data loss or corruption; SLO burn rate ≥ 14.4× sustained; revenue-impacting payment failureImmediate; IC assigned within 5 minVP Engineering and product within 15 min
SEV2 (High)Significant degradation affecting > 10 % of users; SLO burn rate ≥ 6×; dependent service at riskIC assigned within 15 minEngineering manager within 30 min
SEV3 (Medium)Limited degradation, < 10 % of users affected; no data loss; workaround availableAcknowledged within 30 min; resolution within 4 hTeam lead aware
SEV4 (Low)Minor defect; no user-visible impact; caught before it spreadBacklog; tracked for trend analysisNone required

Severity is assessed on symptoms, not on hypotheses. Do not downgrade a SEV1 to SEV2 because you think you know the cause—downgrade only when the customer impact is confirmed to be reduced.

The incident lifecycle

Every incident passes through four phases. The phases are not strictly sequential; detection and triage overlap, and recovery may require multiple containment attempts.

Phase 1: Detection

Detection begins when an alert fires, a user reports an issue, or a synthetic probe fails. The goal of detection is to confirm that a real incident exists (not a flapping alert), form an initial impact statement, and assign a severity.

Detection quality depends entirely on the observability foundations from Observability: SLO-based burn-rate alerts provide high-confidence, actionable signals. Raw-threshold alerts on non-user-visible metrics produce false positives that slow detection.

The on-call engineer who receives the page is the first responder. They must not start fixing things immediately. The first action is triage.

Phase 2: Triage

Triage answers three questions: What is broken? How many users are affected and how severely? What is the most likely cause? The triage engineer opens the runbook for the firing alert, checks the four golden signals, pulls the most recent error traces (filtering by trace_id from the alert context), and declares a severity.

If the incident is SEV1 or SEV2, the first responder immediately activates incident command—they do not attempt to fix the problem solo.

Phase 3: Containment

Containment stops the impact from growing. It does not necessarily fix the root cause. Common containment actions in order of preference:

  1. Traffic shift: route traffic away from the failing instance (blue/green, weighted canary rollback).
  2. Feature flag disable: disable the feature that is causing the failure without a deployment.
  3. Rollback: revert to the previous known-good deployment artefact.
  4. Kill switch / circuit breaker: fail fast on the affected code path; return a graceful degraded response.
  5. Scale out: add capacity if saturation is the cause.
  6. Manual failover: switch to the DR environment (used when the failure is infrastructure-level).

Containment must be fast. A rollback that takes 45 minutes is not a containment tool. Practice and automate rollback so it takes under 5 minutes.

Automation does not remove human accountability. A circuit breaker that opens automatically is a useful safety mechanism, but a named human must own the decision to restore service and must verify that the root cause is addressed before doing so. Automated recovery that masks an unresolved failure leads to repeat incidents.

Phase 4: Recovery and verification

Recovery restores the system to full service. It includes:

After recovery: close the incident ticket, set a PIR meeting, and update the runbook with anything learned during the response.

Incident command

Incident command separates three responsibilities that must not be combined in one person during a high-pressure incident:

RoleResponsibilityWhat they must NOT do
Incident Commander (IC)Owns the incident process: declares severity, assigns tasks, calls in specialists, keeps the timeline, decides when to escalate, calls recoveryPerform technical diagnostics or write code
Communications LeadOwns all external and internal communications: status page updates, stakeholder notifications, customer-facing messagesMake technical decisions
Technical Lead(s)Diagnose the root cause, design and execute the fixCommunicate externally or coordinate with stakeholders

The IC never debugs. The communications lead never diagnoses. This separation prevents the two most common incident failures: the lone expert who fixes things but tells no one what is happening, and the manager who keeps asking for status updates that interrupt the engineers who are trying to fix the problem.

In small teams, one person may cover IC and communications lead, but the technical lead role must always be separate from IC.

Incident channel hygiene: use a dedicated incident channel per incident (Slack, Teams, or equivalent). Off-topic discussion goes to a separate thread. The IC posts a status update every 15 minutes on SEV1 even if there is nothing new to report. This prevents stakeholders from interrupting engineers for updates.

RTO and RPO

RTO (Recovery Time Objective): the maximum acceptable time from incident start to service restoration. A published RTO of 4 hours means that the business accepts up to 4 hours of downtime but no more.

RPO (Recovery Point Objective): the maximum acceptable data loss measured in time. An RPO of 1 hour means the business accepts losing at most 1 hour of data in a complete failure scenario.

RTO and RPO drive backup and recovery design:

RPOBackup strategy
24 hoursDaily full backup to cold storage
4 hoursDaily full + 4-hourly incremental
1 hourContinuous replication (WAL shipping, change data capture)
< 1 minuteActive-active multi-region with synchronous replication

RTO and RPO must be tested. An untested RTO is a guess. A restore test is a scheduled rehearsal where the team restores from backup into a clean environment and measures the actual restoration time. If the measured time exceeds the RTO, the RTO is wrong or the backup strategy needs to change. Restore tests must run at least quarterly and after any significant change to the backup configuration.

Backup design

A complete backup strategy answers six questions:

  1. What is backed up? (Databases, persistent volumes, configuration, secrets, artefact registry)
  2. How often? (Frequency driven by RPO)
  3. Where is the backup stored? (Separate account, separate region, or offline)
  4. How long is it retained? (Must cover the window in which data corruption might be undetected)
  5. How is it restored? (Documented, automated, and tested)
  6. Who owns it? (Named role; not "the team")

The 3-2-1 rule: three copies, on two different media types, with one copy off-site (or in a separate cloud account and region). For a cloud-native service, this typically means: primary database in region A, cross-region replica in region B, and daily snapshot exported to a separate storage account with delete protection enabled.

Never store backup credentials alongside the backup. Credentials must be stored in a secret manager with a separate access policy that the backup restore process can access but the primary application cannot.

Blameless post-incident review (PIR)

A PIR (also: post-mortem) is a structured review of an incident conducted after containment, with the goal of learning and improving—not assigning blame. The term "blameless" means the review asks "how did the system and process allow this to happen?" rather than "who made the mistake?"

Blame is counterproductive for two reasons: it suppresses honest disclosure (engineers hide actions that might implicate them), and it treats a symptom (a person's action) rather than the cause (the system that allowed the action to have that consequence). A blameless culture produces more accurate incident timelines and more effective corrective actions.

A PIR is not optional for SEV1 and SEV2 incidents. The meeting must be scheduled within five working days of containment. The written PIR document must be completed and reviewed by all participants.

PIR structure:

SectionContent
Incident summaryOne paragraph: what happened, when, duration, severity, user impact
TimelineChronological: detection, key actions, containment, recovery, with UTC timestamps
Root causeThe deepest cause identified by iterating the five whys. Technical root cause AND organisational/process root cause.
Contributing factorsConditions that made the failure more likely or harder to detect (incomplete runbook, no restore test, insufficient monitoring)
ImpactUsers affected, revenue impact, SLO budget consumed
What went wellActions that worked; should be reinforced
What did not go wellActions that were ineffective or harmful
Corrective actions (CAPA)Specific, owned, time-bound actions to prevent recurrence and improve detection/response
Regression testA check that can be added to the CI pipeline or monitoring to detect recurrence automatically

CAPA (Corrective and Preventive Action)

A CAPA is the output of a PIR: a list of specific, actionable, and time-bound improvements. Each CAPA item has:

CAPAs are tracked in the same ticket system as features. They are not optional. A PIR without CAPA items is a social event, not an engineering practice.

Chaos engineering awareness

Chaos engineering is the practice of deliberately injecting failures into a system—in a controlled way, usually in a non-production environment—to test whether the system's reliability properties (circuit breakers, fallbacks, alerting, runbooks) behave as expected.

Common experiments:

Chaos engineering is not reckless experimentation. It requires: a hypothesis ("the circuit breaker will open within 5 s of the dependency becoming slow"), a defined steady state to validate against (the SLO), an abort condition (if the SLO degrades beyond the experiment scope, stop), and a rollback plan. Experiments start small (one pod, one endpoint, one dependency) and expand only when the smaller scope is confirmed stable.

Never run chaos experiments in production without: explicit approval from the IC, a communications plan for users, a runbook for unexpected outcomes, and the ability to abort within seconds.

Teacher walkthrough

Build the incident management playbook for the Northline order-processing service.

  1. Set the error-budget policy. The order-processing SLO is 99.5 % availability over 30 days (budget: ~216 minutes). Policy: below 50 % budget, one reliability initiative per sprint; below 25 %, no non-critical feature releases; exhausted, feature freeze. Document this in the team charter and link it from the engineering wiki.
  1. Define the severity model. Populate the severity table with Northline-specific criteria. SEV1: complete order checkout failure or payment gateway down; SEV2: checkout degraded, > 10 % of orders failing; SEV3: isolated failures, workaround available; SEV4: minor defect, no user impact. Assign on-call rotation using PagerDuty escalation policy: primary → secondary → engineering manager (15-minute escalation steps for SEV1).
  1. Assign incident-command roles. IC: the on-call engineer for the primary service. Communications lead: the engineering manager or a dedicated rotation. Technical lead: whoever knows the code path best, assigned by the IC at triage. Write the role cards on a shared doc that the whole team has reviewed.
  1. Define the incident channel protocol. Every SEV1 and SEV2 gets a dedicated Slack channel named #inc-YYYY-MM-DD-{slug}. The IC posts status every 15 minutes. All technical discussion is in threads. External communications go through the communications lead only.
  1. Build the backup and restore strategy. Database (PostgreSQL on RDS): automated daily snapshot retained for 30 days + continuous WAL shipping to a read replica in a second AZ (RPO: < 5 min). Cross-region snapshot exported nightly to northline-backups-eu-west with delete protection and a separate IAM role. Restore test scheduled quarterly; first test must run before the first production release. Document the restore procedure in the runbook.
  1. Write the PIR template. Create a Confluence or Google Doc template with all eight sections above. Link the template from the incident-response runbook. The IC is responsible for scheduling the PIR meeting within 5 working days; the technical lead is responsible for the timeline and root-cause sections; the communications lead is responsible for the impact section.
  1. Define CAPA tracking. All CAPA items are created as Jira tickets in the RELIABILITY project with a dedicated label capa. The engineering manager reviews open CAPAs monthly. CAPAs from a given PIR must be closed or deferred (with written justification) before the incident can be marked resolved in the incident tracker.
  1. Plan the first chaos experiment. Hypothesis: "When the payment gateway returns HTTP 503, the order-processing service returns HTTP 503 (not 500) to the client, the circuit breaker opens within 5 s, and the error rate alert fires within 60 s." Environment: staging with production-like data volume (synthetic). Abort condition: if any real data is affected. Run after the first blue/green deployment is validated.
  1. Rehearse with a tabletop exercise. Script a 30-minute tabletop: "The burn-rate alert fires at 09:42 UTC. The IC is paged. The technical lead identifies that the payment gateway is returning 503s. The communications lead drafts the status page update. The IC calls a rollback." Walk through every step, measure the time for each decision, and identify gaps in the runbook.

Worked example

The script below implements three reliability primitives: an error-budget calculator, an incident severity classifier, and a PIR CAPA tracker. All values are synthetic and deterministic.

# devops10_reliability.py
# Reliability engineering primitives for the Northline order-processing service.
# All data is illustrative.

from datetime import date, timedelta

TODAY = date(2026, 10, 1)

SLO = 0.995              # 99.5 % availability SLO
WINDOW_DAYS = 30
TOTAL_MINUTES = WINDOW_DAYS * 24 * 60   # 43,200 minutes in 30 days
ERROR_BUDGET_MINUTES = TOTAL_MINUTES * (1 - SLO)   # 216 minutes


# --- 1. Error budget calculation ---
def error_budget_status(downtime_minutes, budget_minutes=ERROR_BUDGET_MINUTES):
    consumed = downtime_minutes / budget_minutes
    remaining = 1.0 - consumed
    if remaining <= 0:
        policy = "FEATURE FREEZE — budget exhausted; reliability work only"
    elif remaining < 0.25:
        policy = "FREEZE RELEASES — < 25 % budget remaining; reliability priority"
    elif remaining < 0.50:
        policy = "CAUTION — < 50 % budget; add reliability initiative this sprint"
    else:
        policy = "OK — normal release cadence"
    return consumed, remaining, policy


# --- 2. Severity classifier ---
SEVERITY_TABLE = {
    "SEV1": {
        "response": "Immediate — IC within 5 min",
        "escalation": "VP Engineering and product within 15 min",
    },
    "SEV2": {
        "response": "IC within 15 min",
        "escalation": "Engineering manager within 30 min",
    },
    "SEV3": {
        "response": "Acknowledge within 30 min; resolve within 4 h",
        "escalation": "Team lead aware",
    },
    "SEV4": {
        "response": "Backlog; track for trend",
        "escalation": "None",
    },
}


def classify_severity(burn_rate, users_pct_affected, data_loss):
    """
    Classify an incident severity from observable signals.
    burn_rate       : float — error budget burn rate (1.0 = sustainable pace)
    users_pct_affected : float 0–1 — proportion of users affected
    data_loss       : bool — confirmed or suspected data loss
    """
    if data_loss or burn_rate >= 14.4 or users_pct_affected >= 1.0:
        return "SEV1"
    if burn_rate >= 6.0 or users_pct_affected >= 0.10:
        return "SEV2"
    if users_pct_affected > 0 or burn_rate >= 1.0:
        return "SEV3"
    return "SEV4"


# --- 3. PIR / CAPA tracker ---
OPEN_CAPAS = [
    {
        "id": "CAPA-001",
        "pir": "PIR-2026-09-15",
        "action": "Add payment_gateway_status label to northline_orders_errors_total counter",
        "owner": "Priya K.",
        "due": date(2026, 10, 15),
        "done": False,
        "verify": "Metric label visible in Grafana explore with gateway_status='503'",
    },
    {
        "id": "CAPA-002",
        "pir": "PIR-2026-09-15",
        "action": "Schedule quarterly restore test; add calendar invite and runbook link",
        "owner": "Dev R.",
        "due": date(2026, 10, 8),
        "done": False,
        "verify": "Restore test completed in < RTO; result logged in restore-test-log.md",
    },
    {
        "id": "CAPA-003",
        "pir": "PIR-2026-08-22",
        "action": "Add circuit-breaker configuration to payment-gateway client (timeout 3 s, open at 5 consecutive 503s)",
        "owner": "Arjun M.",
        "due": date(2026, 9, 30),
        "done": True,
        "verify": "Circuit breaker behaviour verified in staging chaos experiment CE-01",
    },
]


def capa_status(capas, today=TODAY):
    overdue = [c for c in capas if not c["done"] and c["due"] < today]
    due_soon = [c for c in capas if not c["done"] and today <= c["due"] <= today + timedelta(days=7)]
    done = [c for c in capas if c["done"]]
    return overdue, due_soon, done


# --- 4. RTO / RPO planner ---
def backup_strategy(rpo_hours):
    """Return a recommended backup strategy for the given RPO."""
    if rpo_hours < 0.017:   # < 1 minute
        return "Active-active multi-region with synchronous replication"
    if rpo_hours <= 1:
        return "Continuous replication (WAL shipping or CDC); cross-region replica"
    if rpo_hours <= 4:
        return "Daily full backup + hourly incremental; cross-AZ replica"
    return "Daily full backup to cold storage"


# --- Run ---
downtime = 95.0   # synthetic: 95 minutes of downtime this window

consumed, remaining, policy = error_budget_status(downtime)
print("=== Northline Order-Processing — Reliability Report ===")
print(f"SLO          : {SLO} ({WINDOW_DAYS}-day window)")
print(f"Budget       : {ERROR_BUDGET_MINUTES:.0f} minutes")
print(f"Downtime     : {downtime:.0f} minutes")
print(f"Consumed     : {consumed:.1%}")
print(f"Remaining    : {remaining:.1%}")
print(f"Policy       : {policy}")
print()

sev = classify_severity(burn_rate=8.5, users_pct_affected=0.15, data_loss=False)
print(f"Incident severity : {sev}")
print(f"  Response  : {SEVERITY_TABLE[sev]['response']}")
print(f"  Escalation: {SEVERITY_TABLE[sev]['escalation']}")
print()

overdue, soon, done = capa_status(OPEN_CAPAS)
print(f"CAPA tracker: {len(done)} done, {len(soon)} due this week, {len(overdue)} overdue")
for c in overdue:
    print(f"  OVERDUE  {c['id']} ({c['pir']}): {c['action'][:60]}... — owner: {c['owner']}")
for c in soon:
    print(f"  DUE SOON {c['id']} due {c['due']}: {c['action'][:60]}... — owner: {c['owner']}")
print()

print(f"Backup strategy for RPO 1 h: {backup_strategy(1)}")
print(f"Backup strategy for RPO 4 h: {backup_strategy(4)}")

Expected output (deterministic with synthetic data):

=== Northline Order-Processing — Reliability Report ===
SLO          : 0.995 (30-day window)
Budget       : 216 minutes
Downtime     : 95 minutes
Consumed     : 44.0%
Remaining    : 56.0%
Policy       : OK — normal release cadence

Incident severity : SEV2
  Response  : IC within 15 min
  Escalation: Engineering manager within 30 min

CAPA tracker: 1 done, 1 due this week, 0 overdue
  DUE SOON CAPA-002 due 2026-10-08: Schedule quarterly restore test; add calendar invite and... — owner: Dev R.

Backup strategy for RPO 1 h: Continuous replication (WAL shipping or CDC); cross-region replica
Backup strategy for RPO 4 h: Daily full backup + hourly incremental; cross-AZ replica

Check your understanding

  1. A service has been down for 95 minutes out of a 30-day window with an SLO of 99.9 %. How much of the error budget is consumed, and what policy should apply to feature releases this week?
  2. An incident has a burn rate of 20×. The engineer on call starts debugging immediately without declaring a severity or calling in the IC. What is wrong with this approach, and what should happen first?
  3. The IC says "the database team should fix this" and moves on to other things without assigning a named technical lead or tracking actions. What failure mode is this, and how does the incident-command model prevent it?
  4. A team has an RPO of 15 minutes. They run daily full backups. Is their backup strategy sufficient? What should they use instead?
  5. A PIR identifies that a junior engineer deployed to production without a review because the deployment pipeline had no mandatory approval gate. The PIR document says "Engineer X should have known better." Why is this a poor PIR root cause, and what is a better framing?
  6. A team proposes running a chaos experiment in production on a Friday afternoon to "see what happens." What is wrong with this plan, and what conditions must be met before any chaos experiment runs?

Summary

ConceptOne-line definition
MTTRMean time to restore; the most operationally actionable reliability metric.
Error budgetComplement of the SLO; governs the release–reliability trade-off with numbers, not opinion.
Severity modelPre-defined criteria for urgency, response time, and escalation path per incident class.
DetectionConfirming a real incident exists and forming an initial impact statement before acting.
TriageAnswering: what is broken, who is affected, what is the likely cause—before fixing.
ContainmentStopping impact growth (rollback, traffic shift, feature flag) before root-cause fix.
RecoveryRestoring full service and confirming the fix is in place.
Incident commandThree roles—IC, comms lead, tech lead—separated to prevent coordination collapse.
RTOMaximum acceptable outage duration; must be tested.
RPOMaximum acceptable data loss in time; drives backup frequency.
Blameless PIRPost-incident review focused on system causes, not individual fault.
CAPASpecific, owned, time-bound corrective and preventive actions from a PIR.
Chaos engineeringControlled failure injection to validate reliability properties; not reckless.

The chain continues: DevSecOps, Governance & Platform Operations wraps the reliability and observability practices in security controls, change governance, and platform-level ownership that scale across many teams.