mcpField
I
incident-response

incident-response

github.com/revitalb-port云与 DevOps061 次安装10 周前更新
代码仓库

关于 incident-response

面向生产事故处理团队的响应技能,提供严重程度分级,并按步骤指导排查、缓解、沟通、恢复和无责复盘。

主要功能

  1. 01严重程度分级与响应时限
  2. 02检测和分诊清单
  3. 03常见故障的缓解选项
  4. 04内外部状态更新指引
  5. 05恢复与复盘步骤

适用场景

  1. 01判定生产故障级别
  2. 02选择即时缓解措施
  3. 03协调事故进展通报
  4. 04记录事后改进经验

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/revitalb-port/skills-registry-demo --skill incident-response

安装后在 Claude Code 中输入/incident-response确认已加载。

详细介绍

事故响应

系统地处理生产事故。

严重级别

级别定义响应时间示例
SEV1服务中断,所有用户均受影响立即数据库崩溃、DNS 故障、身份验证不可用
SEV2主要功能故障,许多用户受影响< 30 分钟支付失败、搜索不可用
SEV3次要功能故障,但有替代方案< 4 小时导出按钮故障、仪表盘缓慢
SEV4外观问题或影响较小的问题下一个工作日UI 中的拼写错误、轻微样式问题

事故处理流程

1. 检测与分类(前 5 分钟)
  • 确认已知悉事故——“我正在查看这个问题”
  • 确定严重级别
  • 检查监控仪表盘(错误率、延迟、状态页)
  • 检查最近的部署:git log --oneline -10——最近是否有部署?
2. 缓解(接下来 15-30 分钟)

目标是先止损,而不是找出根本原因。

快速缓解措施:

  • 回滚:git revert <commit> && deploy——如果问题由部署引起,这是最快的选择
  • 功能开关:禁用故障功能
  • 扩容:如果是容量问题,则增加实例
  • 故障转移:如果主服务不可用,则切换到备用服务
  • 阻止流量:对特定的恶意流量进行速率限制或拦截
3. 沟通

内部:

  • 创建事故频道(#incident-2026-04-10)
  • 每隔 15-30 分钟发布状态更新
  • 分配角色:事故指挥官、沟通负责人、工程师

外部:

  • 更新状态页
  • 如果中断持续时间较长,则向受影响的用户发送邮件/通知
  • 诚实说明:“X 出现问题。我们已找到原因,正在修复。”
4. 解决
  • 部署修复
  • 在生产环境中验证修复有效(检查指标,而不只是确认没有错误)
  • 发布总结并关闭事故频道
5. 事后复盘(48 小时内)

撰写无责备的事后复盘:

# Incident: Payments failing for Stripe webhook
**Date:** 2026-04-10
**Duration:** 45 minutes (14:30 — 15:15 UTC)
**Severity:** SEV2
**Impact:** ~200 users unable to complete purchases

## Timeline
- 14:30 — Alert fires: payment success rate drops to 20%
- 14:35 — On-call engineer acknowledges, begins investigation
- 14:40 — Identified: Stripe webhook endpoint returning 500
- 14:45 — Root cause: migration added NOT NULL column without default
- 14:50 — Fix deployed: added default value to migration
- 15:00 — Payment success rate recovering
- 15:15 — Metrics back to normal, incident closed

## Root Cause
Database migration #47 added a `currency` column with NOT NULL 
but no DEFAULT value. Existing rows were fine (backfilled), but 
new webhook events failed because the insert didn't include `currency`.

## What Went Well
- Alert fired within 5 minutes of the issue starting
- Rollback was considered but the fix was faster

## What Went Wrong
- Migration wasn't tested with live webhook payloads
- No staging test for the webhook flow

## Action Items
- [ ] Add webhook integration test to CI (@alice, due 2026-04-17)
- [ ] Require DEFAULT for all new NOT NULL columns in migration review (@bob)
- [ ] Add runbook for payment failures (@charlie, due 2026-04-14)

提示

  • 先回滚,再调查——速度比优雅更重要
  • 最近一次部署最有可能是问题根源
  • 事后复盘不要追究责任——应着重改进流程
  • 为常见故障模式维护操作手册
  • 在真实事故发生前,通过演练日练习事故响应

评论

支持 Markdown