SuperAPI AI Directory

on-call-runbook

General & other

View repository

Updated 10-16 09:31

About this skill

On-call + Runbook

Use Cases

  • On-call rotation system design
  • Runbook (operations manual) writing
  • Escalation path definition
  • Alert response process
  • New hire On-call training

Core Principles

1. Runbook = 告警的"怎么办"
   每个告警必须有对应 Runbook

2. Runbook 可执行
   不是"检查一下",是具体命令
  1. Update regularly Outdated Runbook = misleading

  2. On-call is not 24/7 one person Rotation + primary/secondary + escalation

  3. On-call is compensated Not unpaid labor


## On-call 制度

```text
轮值周期:每周
主值班:1 人
副值班:1 人(backup)
交接:周一上午 30 分钟

响应时间:
  P1:5 分钟
  P2:15 分钟
  P3:1 小时
  P4:工作时间

升级路径:
  5 min 无响应 → 副值班
  15 min 无响应 → Tech Lead
  30 min 无响应 → Engineering Manager
  1 hour 无响应 → CTO

补偿:
  - 值班津贴
  - 事故处理后调休

Runbook Structure

# [告警名] Runbook

## 告警信息
- 告警名:HighErrorRate
- 触发条件:error_rate > 5% 持续 2 分钟
- 严重度:P1
- 影响:用户无法 [功能]

## 快速诊断
1. 检查最近部署:`kubectl rollout history deployment/app`
2. 检查错误日志:`kubectl logs -l app=my-app --tail=100 | grep ERROR`
3. 检查依赖状态:[第三方状态页 URL]
4. 检查资源:`kubectl top pods -l app=my-app`

## 止血操作
### 如果是最近部署导致
kubectl rollout undo deployment/my-app

### 如果是资源不足
kubectl scale deployment/my-app --replicas=10

### 如果是第三方故障
启用降级开关:[Feature Flag URL]

## 验证恢复
1. 错误率回到 < 1%
2. P99 回到 < 500ms
3. 用户确认功能正常

## 升级条件
- 5 分钟内无法止血 → 升级
- 不确定根因 → 升级
- 数据丢失 → 立即升级

## 相关链接
- Dashboard:[URL]
- 日志:[URL]
- 最近部署:[URL]
- 联系人:[人 + 电话]

Runbook Maintenance

何时更新:
  - 每次事故后(复盘改进项)
  - 架构变更后
  - 新服务上线时
  - 季度评审

谁更新:
  - 事故 IC
  - 服务 Owner
  - On-call 发现过期时

评审:
  - 每季度全量 review
  - 标记过期 / 删除无用

Supporting Templates

  • templates/runbook-template.md — Runbook standard template

Quality Self-check

□ 每个告警有 Runbook
□ Runbook 有具体命令(不是"检查一下")
□ 升级路径明确
□ On-call 轮换
□ 交接文档
□ 定期更新
□ 新人培训
□ 补偿制度

Common Pitfalls

  1. Outdated Runbook——Misleading operations
  2. Runbook too abstract——"Check the logs" is not actionable
  3. No escalation path——One person bears it until collapse
  4. On-call does not rotate——burnout
  5. No handover——The new on-call person does not know last week's situation
  6. Alerts without Runbook——Called in the middle of the night and does not know what to do

Collaboration with other skills

上游:
  incident-response → 事故中用 Runbook
  postmortem → 复盘后更新 Runbook

下游:
  devops-engineer monitoring-alerting → 告警配置