SuperAPI AI Directory

incident-response

General & other

View repository

Updated 10-16 09:30

About this skill

Incident Response

References: Google "Site Reliability Engineering" Chapter 14, PagerDuty Incident Response Guide, Atlassian Incident Management.

Applicable Scenarios

  • Service unavailable / partially unavailable
  • Severe performance degradation (P99 > 5x baseline)
  • Data anomalies / loss
  • Security incidents
  • Third-party dependency failures

Core Principles

1. 止血优先(Mitigate First)
   先恢复服务,再定位根因
   回滚 > 修复 > 扩容 > 降级
  1. Clear roles Incident Commander (IC): decisions Communications Lead: notifications Operations Lead: execution

  2. Escalate without hesitation No progress in 5 minutes → escalate Uncertain → escalate

  3. Real-time logging Log all actions to the timeline

  4. Timely notifications Internal: Slack channel External: status page / customer notifications

  5. No blame Do not discuss "whose fault it is" during the incident Discuss "how to change the process" during the postmortem


## 事故分级

| 级别 | 影响 | 响应时间 | 角色 |
|---|---|---|---|
| P1 Critical | 全用户不可用 / 数据丢失 | 立即 | IC + 全团队 |
| P2 High | 部分用户 / 核心功能降级 | 15 分钟 | IC + 相关人 |
| P3 Medium | 非核心功能 / 少量用户 | 1 小时 | On-call |
| P4 Low | 边缘问题 / 无用户感知 | 工作时间 | 排期修 |

## 响应流程

```text
1. 告警触发 / 用户报告
   ↓
2. On-call 确认(5 分钟内)
   - 是否真实事故?
   - 影响范围?
   - 分级(P1~P4)
   ↓
3. 开 Incident Channel(P1/P2)
   - Slack #incident-YYYY-MM-DD
   - 指定 IC
   ↓
4. 止血(优先级最高)
   - 回滚最近部署
   - 扩容
   - 降级(关闭非核心功能)
   - 切换到备用
   - 限流
   ↓
5. 通知
   - 内部:Slack + 邮件
   - 外部:状态页更新
   - 客户:如影响大
   ↓
6. 定位根因
   - 最近变更?(部署 / 配置 / 数据库)
   - 日志 / 指标 / 追踪
   - 第三方状态?
   ↓
7. 修复
   - 临时修复(hotfix)
   - 或:等止血稳定后排期修
   ↓
8. 验证恢复
   - 指标回到基线
   - 用户确认
   - 告警消除
   ↓
9. 关闭事故
   - 更新状态页
   - 通知恢复
   - 安排复盘
   ↓
10. 复盘(24~72 小时内)
    → postmortem skill

Stop-the-bleeding decision tree

最近有部署?
  YES → 回滚(最快)
  NO ↓

资源不足(CPU/Memory/连接池)?
  YES → 扩容
  NO ↓

第三方挂了?
  YES → 降级 / 切备用
  NO ↓

流量异常(攻击 / 爬虫)?
  YES → 限流 / 封 IP
  NO ↓

数据库问题?
  YES → 联系 DBA / 切从库
  NO ↓

不确定?
  → 回滚最近变更(兜底)

IC (Incident Commander) responsibilities

□ 评估影响和分级
□ 分配角色
□ 决策止血方案
□ 控制节奏(不让人乱)
□ 决定何时升级
□ 决定何时关闭
□ 安排复盘
□ 不亲自排查(除非只有一人)

Notification templates

Internal notification

[P1] 订单服务不可用

影响:所有用户无法创建订单
开始时间:14:30 UTC
当前状态:止血中(已回滚最近部署)
IC:@alice
频道:#incident-2026-05-19

下次更新:15:00 UTC

External status page

[Investigating] 我们正在调查订单创建功能异常。
[Identified] 已定位问题,正在修复。
[Monitoring] 已修复,正在监控。
[Resolved] 问题已解决。影响时间:14:30~15:15 UTC。

Supporting templates

  • templates/incident-template.md — incident record + timeline + impact + stop-the-bleeding + follow-up

Quality self-check

□ 5 分钟内确认
□ 分级正确
□ IC 指定
□ 止血优先
□ 时间线实时记录
□ 通知及时(内部 + 外部)
□ 升级不犹豫
□ 验证恢复
□ 安排复盘
□ 不追责

Common pitfalls

  1. Locate before stopping the bleeding——the outage lasts 30 minutes
  2. One person carries it alone——fatigue leads to errors
  3. Not escalating——the problem expands
  4. Not notifying——customers find out from social media
  5. Not logging the timeline——no evidence for the postmortem
  6. Assigning blame——next time people dare not report
  7. Hesitating to roll back——"it might not be a deployment issue"
  8. Not verifying recovery——thinking it is fixed when it is not
  9. Not scheduling a postmortem——the same incident happens again
  10. IC investigates personally——no one coordinates

Collaboration with other skills

下游:
  postmortem → 复盘
  on-call-runbook → Runbook 更新
  log-analysis → 定位根因
  
上游:
  devops-engineer monitoring-alerting → 告警触发