Okay, the user is asking for a runbook standard covering three specific components: diagnosis trees, verifications, and rollback procedures. This is a structured request for operational documentation, likely from someone in DevOps/SRE or IT operations who needs to standardize incident response.
First, I should define what a runbook is and why standardization matters—consistency, reduced MTTR, knowledge sharing. Then break it into the three requested sections. For diagnosis trees, I'll emphasize flowchart logic and decision points. Verifications need pre/post-checks to avoid cascading failures. Rollback must be deterministic with clear exit criteria.
I should include templates/examples to make it actionable. The user probably wants something they can implement immediately, so I'll add formatting guidelines and ownership principles. Avoid vague advice—focus on concrete steps like "test rollback in staging" or "define success metrics."
Also, highlight common pitfalls: non-unique steps, manual rollbacks, missing verification gates. The tone should be authoritative but practical, like a senior engineer coaching a team. Maybe add a "cheat sheet" summary at the end for quick reference.
Runbook Standard: Diagnosis Trees, Verifications, and Rollback Procedures
1. Purpose & Scope
This standard defines the required structure, content, and quality criteria for operational runbooks focusing on diagnostic workflows, verification checkpoints, and safe rollback procedures. It applies to all production systems, services, and change implementations.
Goal: Reduce Mean Time to Resolution (MTTR), prevent human error during incidents/changes, and ensure consistent, auditable responses.
2. Core Principles
- Single Source of Truth: Each runbook must resolve to one definitive action per decision point.
- Idempotent Steps: Commands/actions can be safely repeated.
- No Assumptions: Explicitly state prerequisites, dependencies, and failure conditions.
- Tested & Current: Runbooks must be validated quarterly or after any relevant system change.
- Audit Trail: All verification and rollback steps must have clear success/failure criteria.
3. Runbook Structure Template
3.1 Metadata Block (Required)
---
Service: [Service Name]
Runbook ID: [RB-XXX]
Owner: [Team/Individual]
Last Reviewed: [YYYY-MM-DD]
Next Review: [YYYY-MM-DD]
Related CI/CD Pipeline: [Link/ID]
Dependencies: [List systems/services]
Severity Level: [P0/P1/P2/P3]
---
3.2 Problem Statement
- Symptom: What the user/alert sees (e.g., "HTTP 5xx errors > 5% for 2 min").
- Impact: Business/technical consequences (e.g., "Checkout flow failing for 20% of users").
- Possible Causes: High-level categories (e.g., "Infrastructure, Application Code, Database, Network").
4. Diagnosis Tree Specification
4.1 Format Requirements
- Use decision trees or flowcharts (Mermaid, Lucidchart, or ASCII art). Avoid linear prose for logic.
- Binary decisions only: Each node must ask a yes/no or true/false question.
- Decision criteria must be measurable: Use metrics, logs, or command outputs (e.g.,
curl -s -o /dev/null -w "%{http_code}" https://service/health).
4.2 Example Diagnosis Tree (Mermaid)
graph TD
A[Alert: High Error Rate] --> B{Error Type?};
B -->|5xx| C[Check App Logs for Stack Traces];
B -->|4xx| D[Check Client Request Patterns];
C --> E{Stack Trace Contains DB Error?};
E -->|Yes| F[Verify DB Connectivity:<br>nc -z db-host 5432];
E -->|No| G[Check Recent Code Deployments];
F --> H{Connection succeeds?};
H -->|No| I[Escalate to Network Team];
H -->|Yes| J[Check DB Query Latency];
4.3 Tree Node Requirements
Each node must include:
- Decision Question (clear, testable).
- Verification Command/Check (exact CLI, API call, or dashboard link).
- Expected Output (what “good” looks like).
- Next Step Path (branch logic).
- Owner for this step (if different).
5. Verification Checkpoints
5.1 Pre-Change Verification (Before Any Action)
| Check ID | What to Verify | Command/Query | Success Criteria | Owner |
|---|
| PRE-01 | Service Health Endpoint | curl -s https://service/health | {"status":"UP"} | App Team |
| PRE-02 | Current Deployment Version | kubectl get deploy -n namespace service -o jsonpath='{.spec.template.spec.containers[0].image}' | Matches v1.2.3 | Infra |
| PRE-03 | Traffic Routing Baseline | istioctl proxy-config routes pod-name | 100% to v1.2.3 | Platform |
5.2 In-Change Verification (During Execution)
- After each major step, verify the intended effect before proceeding.
- Example: After restarting service container, check error rate drops below threshold within 60s.
- Never proceed if verification fails. Trigger rollback immediately.
5.3 Post-Change Verification (After Fix/Rollback)
| Check ID | What to Verify | Command/Query | Success Criteria | Monitoring Link |
|---|
| POST-01 | Error Rate (5min avg) | prometheus-query 'rate(http_requests_total{status=~"5.."}[5m])' | < 0.1% | Grafana Dashboard |
| POST-02 | Latency SLO | prometheus-query 'histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))' | < 300ms | SLO Dashboard |
| POST-03 | Business Metric | analytics-query 'SELECT conversion_rate FROM sessions WHERE hour=NOW()-1' | No regression > 5% | Amplitude |
6. Rollback Procedure Specification
6.1 Rollback Triggers (Automatic & Manual)
- Automatic: Health check failure after 2 minutes, error rate > threshold, SLO burn rate > 2.
- Manual: Operator judgment based on verification failure or new symptoms.
6.2 Rollback Steps Template
## Rollback: [Change ID] - [Brief Description]
**Prerequisites:**
- [ ] You have `ROLLBACK_PERMISSION` role.
- [ ] Backup of current state taken (if applicable): `[describe backup]`.
- [ ] All stakeholders notified (#incidents, product owner).
**Rollback Steps:**
1. **Initiate Rollback:**
```bash
kubectl rollout undo deployment/service --to-revision=<N>
Verify: kubectl rollout status deployment/service → "successfully rolled out"
-
Validate Traffic Routing:
istioctl proxy-config routes pod-name | grep upstream
Expected: 100% traffic to previous version (e.g., v1.2.2).
-
Post-Rollback Verification (Run all POST-XX checks from Section 5.3):
-
If Rollback Fails:
- Immediate action: Halt all deployments, cordon node if needed.
- Escalate: Page
[TEAM] - [PHONE].
- Manual rollback: [Describe manual process, e.g., restore from DB backup, swap DNS].
Rollback Success Criteria:
- All POST-checks pass for 10 consecutive minutes.
- No new alerts triggered.
- Incident commander declares rollback complete.
Rollback Failure Criteria:
- Rollback command errors or times out.
- POST-01 fails after 5 minutes.
- Previous version also unhealthy → Initiate Emergency Procedure: [LINK]
### 6.3 Rollback Safety Rules
1. **Never roll back to a version older than the last known good** (track in change log).
2. **Database/migrations:** If change includes schema migration, **DO NOT** roll back application code without DB rollback plan (often impossible—use forward-fix instead).
3. **Data Loss Check:** If change involved data deletion/modification, rollback may cause corruption → consult data owner first.
4. **Test in staging first:** Rollback procedure **must** be tested in staging quarterly.
---
## 7. Quality Checklist (For Runbook Authors & Reviewers)
- [ ] Diagnosis tree has **no ambiguous branches** (every path leads to a clear action).
- [ ] All verification commands are **copy-paste executable** and tested.
- [ ] Rollback steps include **timeout values** (e.g., `timeout 5m` for health check).
- [ ] **Owner contact** (Slack/phone) listed for any step requiring escalation.
- [ ] Links to **runbooks for dependencies** (e.g., "If DB issue → see RB-DB-002").
- [ ] Rollback procedure **tested in staging** within last 90 days.
- [ ] Document assumes **no prior knowledge**—includes context for junior on-call.
- [ ] Contains **example output** for key commands (good vs bad).
---
## 8. Change Integration Requirement
**No deployment/git push/configuration change is approved without:**
1. Updated runbook (if new failure mode possible).
2. Verification checks defined for that change.
3. Rollback procedure documented and tested.
4. Runbook linked in change ticket (Jira, ServiceNow, etc.).
---
## 9. Maintenance & Ownership
- **Runbook Owner:** Must review/update quarterly or after any incident involving the service.
- **Drill Frequency:** Runbook must be **walked through** in quarterly incident simulations.
- **Version Control:** Runbooks stored as Markdown in `git` with PR reviews required.
- **Deprecation:** If service decommissioned, archive runbook with `DEPRECATED_YYYY-MM-DD` prefix.
---
## 10. Example: Quick Reference Card (One-Pager)
SERVICE: checkout-api | RB-042 | Owner: @team-payments
ALERT: checkout_error_rate > 5%
DIAGNOSIS QUICK PATH:
- Is error 500? → Check app logs:
kubectl logs -l app=checkout --tail=100 | grep ERROR
- Stack trace "DB timeouts" → Run RB-DB-003 (DB Connectivity)
- "Payment gateway timeout" → Check gateway status page
- Is error 400? → Check client request format (see API spec)
VERIFY BEFORE ANY FIX:
- PRE-01: Health OK?
curl /health → {"status":"UP"}
- PRE-03: Current version:
git rev-parse HEAD (from deployment)
ROLLBACK (if fix deployed < 10 min ago):
kubectl rollout undo deploy/checkout -n prod
kubectl rollout status deploy/checkout
# Then run all POST-checks (Section 5.3)
FAILURE? → Page @oncall-payments | CALL: +1-xxx-xxx-xxxx
---
**Approval:** This standard requires sign-off from **Head of SRE, VP Engineering, and Incident Commander Lead**.
**Effective Date:** [DATE]
**Revision History:** v1.0 - Initial release.
---
*Use this standard to create runbooks that turn tribal knowledge into reliable, scalable systems. A perfect runbook lets anyone with basic access resolve an incident in 80% of cases without escalation.*