The user wants a "Runbook Standard" that includes three specific components: "Diagnosis Trees," "Verifications," and "Rollback."
1. Deconstruct the Request:
Topic: Runbook Standard (for IT operations/Software engineering).
Key Components:
Diagnosis Trees: How to troubleshoot issues (flowcharts/decision trees).
Verifications: How to check if things are working (pre/post checks).
Rollback: How to undo changes if things go wrong.
Goal: Create a standardized template or guideline for writing these runbooks.
2. Determine the Structure of the Output:
A good standard document needs structure. I should aim for:
Introduction/Header: Purpose, Scope.
Section 1: General Formatting/Structure: (Briefly, to set the stage).
Section 2: Diagnosis Trees (The "What's broken?" phase): Focus on binary choices and clear outcomes.
Section 3: Verifications (The "Is it fixed?" phase): Focus on objective pass/fail criteria.
Section 4: Rollback (The "Abort!" phase): Focus on safety and versioning.
Example/Template: A concrete example makes abstract standards understandable.
3. Drafting Content - Section by Section:
Introduction: Why do we need this? Consistency, reduced MTTR (Mean Time To Resolve).
Component 1: Diagnosis Trees (Decision Trees):
Concept: Start with a symptom. Branch out based on binary questions (Yes/No).
Standard Requirements:
Must start with a specific alert/symptom.
Use "If/Then/Else" logic.
End with a specific action or escalation.
Avoid ambiguous language (e.g., "Check if slow" -> "Is latency > 200ms?").
Component 2: Verifications (Pre & Post Checks):
Concept: Proving the state of the system.
Standard Requirements:
Pre-flight: What does "healthy" look like before I touch it?
Post-flight: What does "success" look like after the fix?
Idempotency: The check shouldn't change the system state.
Automated vs. Manual: Explicitly state if a script runs this or a human needs to look at logs.
Component 3: Rollback (The Safety Net):
Concept: Returning to the previous known good state.
Standard Requirements:
Trigger: What specific metric triggers a rollback? (Not "it looks bad," but "error rate > 5%").
Steps: Exact commands.
Data State: Handling database migrations (the hardest part of rollback).
Communication: Who to tell when you roll back.
Visuals/Formatting: Markdown is the standard for technical docs. I'll use code blocks, lists, and bold text.
4. Refining the Content (Self-Correction during drafting):
Initial thought: Just list definitions.
Correction: That's too theoretical. I need to provide a standard—meaning a set of rules and a template.
Refining the "Rollback" section: This is critical. I need to emphasize reversibility. Is the operation reversible? If not, the runbook needs a big warning.
5. Creating the "Template" (The deliverable):
I need a sample runbook entry that follows the standard I just defined. Let's use a common scenario like "Deploying a new API version" or "Database Migration." Let's go with "Service Deployment" as it covers all three aspects well.
6. Final Review of the Prompt:
"Create a runbook standard: diagnosis trees, verifications, and rollback."
Check: Did I include Diagnosis Trees? Yes.
Check: Did I include Verifications? Yes.
Check: Did I include Rollback? Yes.
Check: Is it a "Standard"? Yes, defined rules.
7. Final Polish: Use professional tone. Use clear headers. Add a "Pro-tip" section for best practices. (e.g., "Runbooks are alive, update them").
(Self-Correction during drafting the response): I should make sure to distinguish between Diagnosis (fixing an outage) and Execution (deploying code), as runbooks can be for both. The prompt implies a hybrid or focus on incident response with the "Diagnosis" keyword, but "Rollback" implies change management. I will structure the standard to apply to Incident Response (Fixing a break) and Change Management (Making a change), as the three pillars (Diagnose, Verify, Rollback) apply to the intersection of both.
Let's write the response.
This standard defines the structure and requirements for creating production-grade runbooks. The goal is to ensure consistency, reduce Mean Time To Resolution (MTTR), and minimize human error during high-pressure incidents or complex deployments.
Runbook Standard: Structure & Guidelines
1. Meta Information (Header)
Every runbook must start with the following metadata to ensure the user has the correct context.
Title: Clear, action-oriented name (e.g., "API Gateway 502 Troubleshooting").
ID: Unique identifier (e.g., RB-APP-001).
Severity: (e.g., SEV-1, SEV-2, Maintenance).
Owner: Team or individual responsible for updates.
Last Reviewed: Date.
Related Services: Links to dashboards, logs, and architecture diagrams.
2. Phase I: Diagnosis Trees
Diagnosis trees (often called decision trees) are flowcharts used to triage an unknown problem. They guide the engineer through a process of elimination.
Standard Requirements
Start with the Symptom: The entry point must be the alert name or user-visible symptom (e.g., "High Latency Alert" or "Checkout Failing").
Binary Branching: Questions must be answerable with Yes/No or True/False.
Check Data, Not Guesses: Every branch must instruct the engineer to look at specific data (logs, metrics).
End States: Every leaf of the tree must result in one of three outcomes:
Actionable Fix: "Restart pod."
Escalation: "Page DBA team."
False Positive: "Close ticket."
Syntax Standard
Use the following format for text-based decision trees:
text
[START] Alert: High Error Rate on Service X
|
+--- CHECK: Is the error rate > 5%?
| |--> NO: Monitor. (END)
| |--> YES: Proceed to CHECK 2.
|
+--- CHECK: Are dependent services (DB/Redis) healthy?
| |--> NO: Go to Runbook: "Database Connectivity".
| |--> YES: Proceed to CHECK 3.
|
+--- CHECK: Are pods restarting?
|--> YES: Check OOMKilled status.
|--> NO: Check recent deployments.
3. Phase II: Verifications
Verifications are "Pre-flight" and "Post-flight" checks. These ensure that the system is in a known state before you act, and that your action actually worked.
Standard Requirements
Idempotent: Running a verification check must not change the system state.
Automated: Preference given to one-click scripts or CLI commands over manual UI clicking.
Pass/Fail Criteria: Explicitly state what "Good" looks like.
The "Pre-Action" Checklist
Before executing a change or fix, verify:
Current State: What is the baseline metric? (e.g., "Current CPU is 90%").
Access: Do I have the correct permissions/VPN access?
Dependencies: Are downstream systems up?
The "Post-Action" Checklist
After executing a fix, verify:
Metric Return: Did the alerting metric return to the baseline defined in Pre-Action?
Log Silence: Are error logs stopped?
Smoke Test: Run a synthetic transaction (e.g., curl -X GET health_endpoint).
Template:
Verification 1: Confirm Database connectivity.
Command:./scripts/db_ping.shExpected Output:StatusCode: 200, Latency: < 50msIf Fail: Do not proceed. Escalate to DBA.
4. Phase III: Rollback Procedures
A runbook is incomplete without a "Undo" button. This section defines how to revert the system to its previous stable state.
Standard Requirements
The "Panic" Button: A single command or script to initiate the rollback is preferred over a multi-step manual process.
Version Pinning: Explicitly state where to find the previous version/configuration.
Data State: Address data consistency. If you rollback code, does the database schema also need to rollback? (Note: DB rollbacks are often impossible; plan carefully).
Rollback Template
Step
Action
Command / Procedure
Reversible? (Y/N)
1
Revert Traffic Switch
istioctl switch-service --prev
Y
2
Redeploy Old Image
kubectl rollout undo deployment/app
Y
3
Revert DB Migration
Manual SQL execution required
N (High Risk)
Rollback Decision Matrix
Define when to give up on fixing forward and execute the rollback.
Fix Forward: If the fix is simple, tested, and low risk.
Rollback: If the root cause is unknown after 15 minutes OR if the fix attempts failed.
Criteria: "If Error Rate > 10% for > 5 mins post-fix, execute Rollback immediately."
5. Example: Diagnosis, Verification & Rollback in Action
Scenario: Deployment of Payment-Service v2.4
Section A: Diagnosis (Why is it failing?)
Symptom: Users reporting "Payment Declined" but logs show 200 OK.
Tree:
Is the 3rd party provider (Stripe) up? -> YES (Checked Status Page).
Is the API key rotated? -> YES (Checked secrets).
Is the request payload format correct? -> CHECK LOGS.
Result: Payload includes new field zipcode which vendor rejects.
Section B: Verification (Are we sure?)
Pre-Fix: Capture a single failing request ID.
Post-Fix: Retry that specific request ID via the admin console.
Success Criteria: Request returns 200 OK and funds captured.