视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
write-incident-runbook【文档与办公】Create structured incident runbooks with diagnostic steps, resolution procedures, escalation paths, and communication templates for effective incident response. Use when documenting response procedures for recurring alerts, standardizing incident response across an on-call rotation, reducing MTTR with clear diagnostic steps, creating training materia…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Actionable runbooks → guide responders through incident diagnosis + resolution.
See Extended Examples for complete template files.
Select per incident type + complexity.
Basic runbook template structure:
# [Alert/Incident Name] Runbook
## Overview | Severity | Symptoms
## Diagnostic Steps | Resolution Steps
## Escalation | Communication | Prevention | Related
Advanced SRE template (excerpt):
# [Service Name] - [Incident Type] Runbook
## Metadata
- Service, Owner, Severity, On-Call, Last Updated
## Diagnostic Phase
### Quick Health Check (< 5 min): Dashboard, error rate, deployments
### Detailed Investigation (5-20 min): Metrics, logs, traces, failure patterns
# ... (see EXAMPLES.md for complete template)
Key components:
Got: Template selected matches incident complexity, sections appropriate for service type.
If err:
See Extended Examples for complete diagnostic queries and decision trees.
Step-by-step investigation w/ specific queries.
6-step checklist:
Verify Service Health: Health endpoint + uptime metrics
curl -I https://api.example.com/health # Expected: HTTP 200 OK
up{job="api-service"} # Expected: 1 for all instances
Check Error Rate: Current % + breakdown by endpoint
sum(rate(http_requests_total{status=~"5.."}[5m]))
/ sum(rate(http_requests_total[5m])) * 100 # Expected: < 1%
Analyze Logs: Recent errs + top err msgs from Loki
{job="api-service"} |= "error" | json | level="error"
Resource Util: CPU, memory, conn pool status
avg(rate(container_cpu_usage_seconds_total{pod=~"api-service.*"}[5m])) * 100
# Expected: < 70%
Recent Changes: Deployments, git commits, infra changes
Dependencies: Downstream service health, DB|API latency
Failure pattern decision tree (excerpt):
Got: Diagnostic procedures specific, expected vs actual vals, guides responder.
If err:
See Extended Examples for all 5 resolution options with full commands and rollback procedures.
Step-by-step remediation w/ rollback.
5 resolution options (brief):
Rollback Deployment (fastest): For post-deployment errs
kubectl rollout undo deployment/api-service
Verify → Monitor → Confirm (err rate < 1%, latency normal, no alerts)
Scale Up: High CPU|memory, conn pool exhaustion
kubectl scale deployment/api-service --replicas=$((current * 3/2))
Restart Service: Memory leaks, stuck conns, cache corruption
kubectl rollout restart deployment/api-service
Feature Flag | Circuit Breaker: Specific feature errs|external dep failures
kubectl set env deployment/api-service FEATURE_NAME=false
DB Remediation: Conns, slow queries, pool exhaustion
-- Kill long-running queries, restart connection pool, increase pool size
Universal verify checklist:
Rollback: Resolution worsens → pause|cancel → revert → reassess
Got: Resolution clear, verify checks, rollback options per action.
If err:
See Extended Examples for full escalation levels and contact directory template.
When + how to escalate.
Escalate immediately:
5 escalation levels:
Process:
Contact directory: Table w/ role, Slack, phone, PagerDuty for:
Got: Clear escalation criteria, contact info accessible, paths align w/ org.
If err:
See Extended Examples for all internal and external templates with full formatting.
Pre-written msgs for incident updates.
Internal (Slack #incident-response):
Initial Declaration:
🚨 INCIDENT: [Title] | Severity: [Critical/High/Medium]
Impact: [users/services] | Owner: @username | Dashboard: [link]
Quick Summary: [1-2 sentences] | Next update: 15 min
Progress Update (every 15-30 min):
📊 UPDATE #N | Status: [Investigating/Mitigating/Monitoring]
Actions: [what we tried and outcomes]
Theory: [what we think is happening]
Next: [planned actions]
Mitigation Complete:
✅ MITIGATION | Metrics: Error [before→after], Latency [before→after]
Root Cause: [brief or "investigating"] | Monitoring 30min before resolved
Resolution:
🎉 RESOLVED | Duration: [time] | Root Cause + Impact + Follow-up actions
False Alarm: No impact, no follow-up
External (status page):
Customer email template: Timeline, impact, resolution, prevention, compensation (if applicable)
Got: Templates save time, consistent comm, reduce cognitive load on responders.
If err:
See Extended Examples for complete Prometheus alert configuration and Grafana dashboard JSON.
Integrate w/ alerts + dashboards.
Add runbook links to Prometheus alerts:
- alert: HighErrorRate
annotations:
runbook_url: "https://wiki.example.com/runbooks/high-error-rate"
dashboard_url: "https://grafana.example.com/d/service-overview"
incident_channel: "#incident-platform"
Embed quick diagnostic links in runbook:
Grafana dashboard panel w/ runbook links (md panel listing all incident runbooks w/ on-call + escalation)
Got: Responders access runbooks direct from alerts|dashboards, diagnostic queries pre-filled, one-click access.
If err:
configure-alerting-rules — Link runbooks to alert annotations for immediate accessbuild-grafana-dashboards — Embed runbook links in dashboards + diagnostic panelssetup-prometheus-monitoring — Diagnostic queries from Prometheus in runbook proceduresdefine-slo-sli-sla — Reference SLO impact in incident severity classification