@luanpdd/kit-mcp 1.8.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/README.md +97 -1
- package/gates/golden-signals-coverage.md +133 -0
- package/gates/obs-agents-mcp-supabase.md +86 -0
- package/gates/obs-skills-frontmatter.md +76 -0
- package/gates/omm-no-regression.md +83 -0
- package/gates/postmortem-template-required.md +127 -0
- package/gates/prr-checklist-coverage.md +128 -0
- package/gates/skill-must-include.md +21 -19
- package/kit/agents/burn-rate-forecaster.md +160 -0
- package/kit/agents/golden-signals-instrumenter.md +241 -0
- package/kit/agents/incident-investigator.md +245 -0
- package/kit/agents/observability-instrumenter.md +200 -0
- package/kit/agents/omm-auditor.md +251 -0
- package/kit/agents/postmortem-writer.md +282 -0
- package/kit/agents/prr-conductor.md +288 -0
- package/kit/agents/slo-engineer.md +224 -0
- package/kit/agents/supabase-architect.md +62 -0
- package/kit/agents/supabase-auth-bootstrapper.md +17 -0
- package/kit/agents/supabase-edge-fn-writer.md +124 -0
- package/kit/agents/supabase-migration-writer.md +98 -0
- package/kit/agents/supabase-realtime-implementer.md +23 -0
- package/kit/agents/supabase-rls-writer.md +17 -0
- package/kit/agents/supabase-storage-implementer.md +174 -0
- package/kit/agents/toil-auditor.md +277 -0
- package/kit/commands/auditar-marco.md +102 -1
- package/kit/commands/auditar-observabilidade.md +103 -0
- package/kit/commands/auditar-toil.md +129 -0
- package/kit/commands/burn-rate-status.md +140 -0
- package/kit/commands/concluir-marco.md +73 -1
- package/kit/commands/definir-slo.md +108 -0
- package/kit/commands/discutir-fase.md +26 -0
- package/kit/commands/forense.md +83 -1
- package/kit/commands/golden-signals.md +142 -0
- package/kit/commands/instrumentar-fase.md +200 -0
- package/kit/commands/investigar-producao.md +162 -0
- package/kit/commands/observabilidade.md +116 -0
- package/kit/commands/planejar-fase.md +20 -0
- package/kit/commands/postmortem.md +179 -0
- package/kit/commands/prr.md +205 -0
- package/kit/commands/risk-budget.md +220 -0
- package/kit/commands/sre.md +227 -0
- package/kit/commands/verificar-trabalho.md +26 -0
- package/kit/skills/_shared-observability/glossary.md +396 -0
- package/kit/skills/_shared-sre/glossary.md +573 -0
- package/kit/skills/blameless-postmortems/SKILL.md +340 -0
- package/kit/skills/burn-rate-alerting/SKILL.md +258 -0
- package/kit/skills/core-analysis-loop/SKILL.md +352 -0
- package/kit/skills/distributed-tracing/SKILL.md +362 -0
- package/kit/skills/eliminating-toil/SKILL.md +243 -0
- package/kit/skills/event-based-slos/SKILL.md +296 -0
- package/kit/skills/four-golden-signals/SKILL.md +297 -0
- package/kit/skills/observability-driven-development/SKILL.md +315 -0
- package/kit/skills/observability-maturity-model/SKILL.md +222 -0
- package/kit/skills/opentelemetry-standard/SKILL.md +351 -0
- package/kit/skills/production-readiness-review/SKILL.md +305 -0
- package/kit/skills/sre-risk-management/SKILL.md +221 -0
- package/kit/skills/structured-events/SKILL.md +265 -0
- package/kit/skills/telemetry-pipelines/SKILL.md +259 -0
- package/kit/skills/telemetry-sampling/SKILL.md +256 -0
- package/package.json +1 -1
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blameless-postmortems
|
|
3
|
+
description: Use após incident SEV1/SEV2 — template canônico (9 seções), cultura blameless (foco em sistema, não pessoas), no postmortem left unreviewed, Wheel of Misfortune.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SRE — Blameless Postmortems
|
|
7
|
+
|
|
8
|
+
## Quando usar
|
|
9
|
+
|
|
10
|
+
LLM carrega esta skill ao escrever postmortem após incident, revisar postmortem de par, ou conduzir Wheel of Misfortune. Trigger phrases:
|
|
11
|
+
|
|
12
|
+
- "postmortem", "post-mortem"
|
|
13
|
+
- "incident review"
|
|
14
|
+
- "blameless", "sem culpa"
|
|
15
|
+
- "root cause analysis", "5 whys"
|
|
16
|
+
- "Wheel of Misfortune"
|
|
17
|
+
- "lessons learned"
|
|
18
|
+
- "Google SRE cap 15"
|
|
19
|
+
- "no postmortem left unreviewed"
|
|
20
|
+
|
|
21
|
+
## Regras absolutas
|
|
22
|
+
|
|
23
|
+
- **Foco em sistema/processo, NÃO em pessoas** — root cause é "ausência de canary release" ou "RPS limit não documentado", NÃO "Maria fez deploy errado". Pessoas são parte do sistema. Se Maria errou, pergunte: "que processo permitiu o erro chegar a prod?".
|
|
24
|
+
- **Trigger postmortem para SEV1/SEV2 + near-miss notáveis** — todo incident customer-facing com impacto ≥ 1 min de SLO burn ou ≥ 1 user reportado. Near-miss (incident detectado antes de impacto) também: oportunidade de aprender sem custo.
|
|
25
|
+
- **"No postmortem left unreviewed"** — todo postmortem revisado por par sênior antes de arquivar. Sem revisão, postmortem mente (involuntariamente — autor está perto demais).
|
|
26
|
+
- **Action items SMART com owner nomeado** — Specific, Measurable, Assignable, Realistic, Time-bound. "Melhorar monitoring" NÃO é SMART. "Adicionar alert SLO burn rate em /api/v1/orders por @bob até 2026-05-15" É SMART.
|
|
27
|
+
- **Timeline em UTC** — não "horário local Brasília" ou ambíguo. Times distribuídos compõem timeline e UTC é o único timezone universal. Sempre `HH:MM UTC`.
|
|
28
|
+
- **Quantificar impact** — usuários afetados (número/percentual), revenue impact, SLO budget consumido. Sem quantificação, severity é subjetivo.
|
|
29
|
+
- **Lições generalizáveis, não específicas** — "Adicionar alert para essa query específica" é local. "Adicionar alert SLO em todas as queries de write em paths críticos" é generalizável.
|
|
30
|
+
- **Wheel of Misfortune trimestral** — exercício de role-play onde uma pessoa narra um incident histórico e o time pratica response (sem dados reais expostos a stress real). Treina muscle memory para SEV1.
|
|
31
|
+
|
|
32
|
+
## Patterns canônicos
|
|
33
|
+
|
|
34
|
+
### Pattern: template canônico de postmortem (9 seções)
|
|
35
|
+
|
|
36
|
+
````markdown
|
|
37
|
+
```markdown
|
|
38
|
+
# Postmortem: <incident-id> — <título-curto>
|
|
39
|
+
|
|
40
|
+
**Data do incident:** YYYY-MM-DD
|
|
41
|
+
**Autores:** <nomes>
|
|
42
|
+
**Status:** Draft | Reviewed | Final
|
|
43
|
+
**Severidade:** SEV1 | SEV2 | SEV3
|
|
44
|
+
**Tempo até detecção:** XX min (entre trigger e alerta)
|
|
45
|
+
**Tempo até resolução:** XX min (entre alerta e SLO restored)
|
|
46
|
+
|
|
47
|
+
## Summary
|
|
48
|
+
|
|
49
|
+
1-2 parágrafos: o que aconteceu, quem foi afetado, como foi resolvido.
|
|
50
|
+
Escrito para audiência não-técnica (executivos, customer success, support).
|
|
51
|
+
|
|
52
|
+
## Impact
|
|
53
|
+
|
|
54
|
+
- Usuários afetados: XX% (X de Y usuários ativos no período)
|
|
55
|
+
- Duração: HH:MM (de HH:MM UTC a HH:MM UTC)
|
|
56
|
+
- SLO budget consumido: X% do budget mensal
|
|
57
|
+
- Revenue impact: $X (estimado por # de transações falhadas × ticket médio)
|
|
58
|
+
- Serviços downstream impactados: <lista>
|
|
59
|
+
- Customer support tickets gerados: X
|
|
60
|
+
- Reputação/marca: <impacto qualitativo, se houver>
|
|
61
|
+
|
|
62
|
+
## Root Causes
|
|
63
|
+
|
|
64
|
+
Condição mais profunda que, removida, previne recorrência.
|
|
65
|
+
NÃO é "deploy do fulano" ou "código tinha bug" — é a condição sistêmica que
|
|
66
|
+
permitiu o bug chegar a prod (ausência de canary, ausência de SLO alert,
|
|
67
|
+
teste não cobria o caso).
|
|
68
|
+
|
|
69
|
+
Use **5 Whys** para chegar lá. Pode haver múltiplas root causes (separadas
|
|
70
|
+
em subseções `### Root Cause 1`, `### Root Cause 2`).
|
|
71
|
+
|
|
72
|
+
## Trigger
|
|
73
|
+
|
|
74
|
+
Evento que iniciou a falha (deploy X às HH:MM UTC, config change Y, traffic
|
|
75
|
+
spike Z, dependency outage W). Trigger ≠ Root Cause — trigger é o "quando";
|
|
76
|
+
root cause é o "porquê o trigger virou incident".
|
|
77
|
+
|
|
78
|
+
## Resolution
|
|
79
|
+
|
|
80
|
+
Passos tomados para recuperar serviço, em ordem cronológica com horários UTC:
|
|
81
|
+
|
|
82
|
+
- HH:MM UTC — <ação>
|
|
83
|
+
- HH:MM UTC — <ação>
|
|
84
|
+
|
|
85
|
+
Inclui rollbacks, hotfixes, scaling decisions, manual interventions.
|
|
86
|
+
|
|
87
|
+
## Detection
|
|
88
|
+
|
|
89
|
+
Como descobrimos: alerta SLO burn rate? cliente reportou? monitoramento
|
|
90
|
+
interno? heartbeat?
|
|
91
|
+
|
|
92
|
+
Tempo de detecção (gap entre trigger e detecção). Se > 5 min, action item
|
|
93
|
+
para reduzir.
|
|
94
|
+
|
|
95
|
+
## Action Items
|
|
96
|
+
|
|
97
|
+
| # | Action (SMART) | Owner | Priority | Due |
|
|
98
|
+
|---|----------------|-------|----------|-----|
|
|
99
|
+
| 1 | Adicionar SLO burn rate alert em /api/v1/orders/{id} | @bob | P0 | 2026-05-15 |
|
|
100
|
+
| 2 | Documentar RPS limit por tier em runbook do orders-service | @alice | P1 | 2026-05-22 |
|
|
101
|
+
| 3 | Implementar canary release em CI para todos os Edge Functions | @platform | P1 | 2026-06-01 |
|
|
102
|
+
|
|
103
|
+
## Lessons Learned
|
|
104
|
+
|
|
105
|
+
Insights generalizáveis. Estrutura recomendada:
|
|
106
|
+
|
|
107
|
+
### O que fizemos bem
|
|
108
|
+
- <coisa que funcionou — reforçar>
|
|
109
|
+
|
|
110
|
+
### Onde podemos melhorar
|
|
111
|
+
- <gap identificado, generalizável a outros sistemas>
|
|
112
|
+
|
|
113
|
+
### Foi lucky?
|
|
114
|
+
- <foi sorte que detectamos rápido? que não escalou? — capturar para fix proativo>
|
|
115
|
+
|
|
116
|
+
## Timeline (UTC)
|
|
117
|
+
|
|
118
|
+
- 14:23 — <evento>
|
|
119
|
+
- 14:27 — <evento>
|
|
120
|
+
- 14:33 — <evento>
|
|
121
|
+
- 14:42 — <evento>
|
|
122
|
+
- 15:25 — Incident resolvido
|
|
123
|
+
|
|
124
|
+
## Supporting evidence
|
|
125
|
+
|
|
126
|
+
- Link para incident channel #inc-2026-05-06-01
|
|
127
|
+
- Link para SLO dashboard
|
|
128
|
+
- Link para investigation .planning/investigations/<id>.md (de incident-investigator v1.9)
|
|
129
|
+
- Screenshots/queries de chave
|
|
130
|
+
```
|
|
131
|
+
````
|
|
132
|
+
|
|
133
|
+
### Pattern: 5 whys para encontrar root cause
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
Sintoma: SLO burn rate de checkout_success disparou às 14:31 UTC.
|
|
137
|
+
|
|
138
|
+
Why 1: Por que o burn rate disparou?
|
|
139
|
+
→ Porque taxa de erro em /api/v1/orders saltou de 0.05% para 8%.
|
|
140
|
+
|
|
141
|
+
Why 2: Por que a taxa de erro saltou?
|
|
142
|
+
→ Porque deploy v2.3.0 introduziu N+1 query.
|
|
143
|
+
|
|
144
|
+
Why 3: Por que o deploy v2.3.0 chegou a prod com N+1?
|
|
145
|
+
→ Porque o teste de carga não cobria carrinhos com > 10 itens.
|
|
146
|
+
|
|
147
|
+
Why 4: Por que o teste de carga não cobria > 10 itens?
|
|
148
|
+
→ Porque o teste foi escrito antes do feature de "bulk add to cart" e não foi atualizado.
|
|
149
|
+
|
|
150
|
+
Why 5: Por que o teste não foi atualizado quando bulk add foi mergeado?
|
|
151
|
+
→ Porque não há gate de CI que exige re-rodar load test ao mudar paths críticos.
|
|
152
|
+
|
|
153
|
+
ROOT CAUSE: ausência de gate de CI obrigando re-rodar load test em mudanças de paths críticos.
|
|
154
|
+
ACTION ITEM: implementar gate `load-test-required-for-critical-paths` no CI.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Pattern: revisão por par sênior ("no postmortem left unreviewed")
|
|
158
|
+
|
|
159
|
+
```markdown
|
|
160
|
+
Reviewer pergunta autor:
|
|
161
|
+
|
|
162
|
+
1. **Root cause é sistêmico, não pessoal?** — se cita pessoa, redirecionar para processo
|
|
163
|
+
2. **Action items são SMART?** — owner nomeado, due date, mensurável
|
|
164
|
+
3. **Timeline em UTC?** — sem ambiguidade timezone
|
|
165
|
+
4. **Impact quantificado?** — # usuários, duração, revenue
|
|
166
|
+
5. **Lessons generalizáveis?** — aplicáveis a outros serviços/incidents
|
|
167
|
+
6. **Detection time razoável?** — < 5 min ideal; se > 5, action item para reduzir
|
|
168
|
+
7. **Algo "lucky" capturado?** — foi sorte? Como remover dependência de sorte?
|
|
169
|
+
8. **5 whys aplicado?** — ou parou em "deploy ruim" sem ir mais fundo?
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Pattern: Wheel of Misfortune (training canônico)
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
Frequência: trimestral (1× por quarter)
|
|
176
|
+
Duração: 60-90 min
|
|
177
|
+
Participantes: time on-call + interessados (4-8 pessoas idealmente)
|
|
178
|
+
|
|
179
|
+
Setup:
|
|
180
|
+
1. Facilitator escolhe um postmortem REAL de incident passado (>3 meses,
|
|
181
|
+
para não ter risco emocional fresco) — pode ser de outro time/empresa.
|
|
182
|
+
2. Facilitator narra timeline progressivamente, parando em pontos-chave.
|
|
183
|
+
3. Em cada parada, time discute: "O que vocês fariam agora? Por quê?"
|
|
184
|
+
4. Comparar respostas com decisão real do incident.
|
|
185
|
+
5. Discutir: "Quais decisões foram boas? Quais foram piores em retrospecto?"
|
|
186
|
+
|
|
187
|
+
Resultado:
|
|
188
|
+
- Time pratica response sem stress real
|
|
189
|
+
- Identifica gaps de conhecimento (nem todos sabem sobre runbook X)
|
|
190
|
+
- Cria muscle memory para próximo SEV1
|
|
191
|
+
- Materializa lições do postmortem original em ação prática
|
|
192
|
+
|
|
193
|
+
Anti-objetivo:
|
|
194
|
+
NÃO é "humilhar quem tomou decisão errada no incident original".
|
|
195
|
+
É blameless training — focar em sistema/processo de decisão.
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Pattern: postmortem chain — `/forense` → `/postmortem`
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
Fluxo natural após incident:
|
|
202
|
+
|
|
203
|
+
1. Detecção: alerta SLO burn rate dispara → on-call ack → Slack channel #inc-NN
|
|
204
|
+
2. Mitigation: rollback ou hotfix → SLO restored → incident closed
|
|
205
|
+
3. /forense (framework v1.10): Core Analysis Loop sobre logs/git/state →
|
|
206
|
+
gera .planning/investigations/<id>.md com hipóteses validadas e root cause
|
|
207
|
+
4. /postmortem --from-investigation <id> (Phase 38):
|
|
208
|
+
postmortem-writer (Phase 37) consome <id>.md e gera template preenchido
|
|
209
|
+
em .planning/postmortems/<id>.md
|
|
210
|
+
5. Reviewer lê draft e exige fixes (no postmortem left unreviewed)
|
|
211
|
+
6. Final marked + archived em milestone correspondente
|
|
212
|
+
7. Action items P0 viram phases inseridas no roadmap próximo (`/inserir-fase`)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Anti-patterns
|
|
216
|
+
|
|
217
|
+
### ANTI: blame culture
|
|
218
|
+
|
|
219
|
+
```text
|
|
220
|
+
ANTI: postmortem nomeia "fulano fez deploy errado", "@maria não testou direito",
|
|
221
|
+
"o time de X causou o problema"
|
|
222
|
+
|
|
223
|
+
PROBLEMA: engineers escondem incidents próximos ao limite por medo de retaliação;
|
|
224
|
+
psychological safety colapsa; replicação garantida (próximo near-miss
|
|
225
|
+
vira full incident porque ninguém reportou); team rotation aumenta;
|
|
226
|
+
quem fica deixa de propor mudanças arriscadas (mesmo as boas).
|
|
227
|
+
|
|
228
|
+
CERTO: foco em sistema/processo (ausência de canary, ausência de rollback
|
|
229
|
+
automatizado, gate de CI faltante); pessoas são parte do sistema, NÃO
|
|
230
|
+
o root cause; revisão por par sênior antes de arquivar — reviewer
|
|
231
|
+
redireciona toda menção a pessoa para "que processo permitiu?".
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### ANTI: action items vagos
|
|
235
|
+
|
|
236
|
+
```text
|
|
237
|
+
ANTI: "Melhorar monitoring", "Revisitar processo de deploy", "Investigar mais",
|
|
238
|
+
"Documentar melhor"
|
|
239
|
+
|
|
240
|
+
PROBLEMA: sem owner, sem due date, sem critério de "feito"; ficam pendentes
|
|
241
|
+
para sempre; mesma falha repete em 6 meses porque nada concreto
|
|
242
|
+
aconteceu; aprendizado do incident é perdido na próxima sprint.
|
|
243
|
+
|
|
244
|
+
CERTO: SMART (Specific, Measurable, Assignable, Realistic, Time-bound) —
|
|
245
|
+
"Bob adiciona SLO burn alert em /api/v1/orders até 2026-05-15";
|
|
246
|
+
"Alice documenta RPS limit em runbook orders-service até 2026-05-22".
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### ANTI: postmortem left unreviewed
|
|
250
|
+
|
|
251
|
+
```text
|
|
252
|
+
ANTI: autor escreve postmortem, ninguém revisa, vai direto para o arquivo
|
|
253
|
+
|
|
254
|
+
PROBLEMA: autor está perto demais (mente involuntariamente sobre próprio
|
|
255
|
+
papel — sem má-fé, é a natureza humana); root cause errado
|
|
256
|
+
documentado; lições não-generalizáveis; mesma falha repete porque
|
|
257
|
+
ação errada foi tomada com base em diagnóstico errado.
|
|
258
|
+
|
|
259
|
+
CERTO: revisor sênior aplica checklist (8 perguntas — ver Pattern: revisão
|
|
260
|
+
por par sênior); só depois `Final` status; "no postmortem left
|
|
261
|
+
unreviewed" é regra absoluta — incident sem postmortem revisado
|
|
262
|
+
conta como aberto, mesmo que serviço esteja restaurado.
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### ANTI: postmortem só para SEV1
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
ANTI: "só investigar incident que pagou on-call"; SEV2/SEV3 ignorados;
|
|
269
|
+
near-misses (detecção rápida evitou impacto) descartados
|
|
270
|
+
|
|
271
|
+
PROBLEMA: near-misses são oportunidade de aprender SEM CUSTO — perdê-los
|
|
272
|
+
é desperdício; SEV3s acumulam até virar SEV1 (mesma classe de
|
|
273
|
+
falha, escala diferente); tendências invisíveis (3 SEV3s em 1 mês
|
|
274
|
+
no mesmo serviço = sinal); team perde músculo de investigação.
|
|
275
|
+
|
|
276
|
+
CERTO: SEV1/SEV2 mandatório; SEV3 opcional mas encorajado; near-miss notável
|
|
277
|
+
(detection rápida evitou impacto) é candidato a postmortem leve
|
|
278
|
+
(Summary + Impact + Lessons Learned, sem timeline detalhada se durou
|
|
279
|
+
< 1 min). Investigation barata, lição grátis.
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### ANTI: timeline ambígua
|
|
283
|
+
|
|
284
|
+
```text
|
|
285
|
+
ANTI: "Por volta das 14h", "After lunch", "Em horário de pico",
|
|
286
|
+
"Ontem à tarde"
|
|
287
|
+
|
|
288
|
+
PROBLEMA: reviewers de outros timezones perdem contexto (15h Brasília
|
|
289
|
+
= 18h UTC = 11h US-East); reconstrução em > 30 dias impossível
|
|
290
|
+
(lembra "horário de pico"?); análise estatística (MTTR
|
|
291
|
+
distribution, time-to-detect) impossível sem timestamps; cross-
|
|
292
|
+
incident correlation falha.
|
|
293
|
+
|
|
294
|
+
CERTO: sempre `HH:MM UTC` no formato 24h; cada evento na timeline com
|
|
295
|
+
timestamp; UTC é o único timezone universal — converter quando
|
|
296
|
+
compartilhar com stakeholders locais, NUNCA armazenar local.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### ANTI: copy-paste de postmortem template sem investigation
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
ANTI: abrir template, preencher campos genéricos, "Resolution: investigamos
|
|
303
|
+
e resolvemos", "Root Cause: bug no código"; sem dados, sem 5 whys
|
|
304
|
+
|
|
305
|
+
PROBLEMA: root cause errado documentado; action items irrelevantes;
|
|
306
|
+
lessons learned superficiais; falha equivalente em 3 meses
|
|
307
|
+
porque diagnóstico verdadeiro nunca foi feito; postmortem vira
|
|
308
|
+
ritual burocrático em vez de instrumento de aprendizado.
|
|
309
|
+
|
|
310
|
+
CERTO: postmortem nasce de investigation real (Core Analysis Loop, /forense,
|
|
311
|
+
ou logs/state via mcp__supabase__get_logs); preencher com EVIDÊNCIAS
|
|
312
|
+
(queries que rodaram, logs específicos, métricas observadas), não
|
|
313
|
+
impressões; cada Root Cause precisa de prova citável.
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Verificação
|
|
317
|
+
|
|
318
|
+
Antes de marcar postmortem como `Final`:
|
|
319
|
+
|
|
320
|
+
1. **9 seções canônicas presentes** — Summary, Impact, Root Causes, Trigger, Resolution, Detection, Action Items, Lessons Learned, Timeline UTC
|
|
321
|
+
2. **Root cause sistêmico** — não nomeia pessoa; passou pelo 5 whys
|
|
322
|
+
3. **Action items SMART** — Specific, Measurable, Assignable (owner @user), Realistic, Time-bound (due date)
|
|
323
|
+
4. **Timeline em UTC** — sem timezone ambíguo
|
|
324
|
+
5. **Impact quantificado** — # usuários, duração HH:MM, SLO budget consumido, revenue
|
|
325
|
+
6. **Lições generalizáveis** — aplicáveis a outros serviços/incidents
|
|
326
|
+
7. **Reviewed por par sênior** — checklist 8 perguntas aplicado
|
|
327
|
+
8. **Supporting evidence linkada** — investigation, dashboards, queries
|
|
328
|
+
9. **Action items P0 escalonados** — viraram phases ou tasks no roadmap próximo
|
|
329
|
+
|
|
330
|
+
## Ver também
|
|
331
|
+
|
|
332
|
+
- [`_shared-sre/glossary.md`](../_shared-sre/glossary.md) — termos canônicos postmortem, blameless, root cause, Wheel of Misfortune
|
|
333
|
+
- [`core-analysis-loop`](../core-analysis-loop/SKILL.md) (v1.9) — Core Analysis Loop alimenta investigation que vira postmortem
|
|
334
|
+
- [`sre-risk-management`](../sre-risk-management/SKILL.md) — postmortem documenta budget consumido
|
|
335
|
+
- [`production-readiness-review`](../production-readiness-review/SKILL.md) — PRR axis "Emergency Response" exige postmortem culture
|
|
336
|
+
- [`eliminating-toil`](../eliminating-toil/SKILL.md) — toil-induced incidents geram postmortems
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
*Material-fonte: Site Reliability Engineering — Beyer, Jones, Petoff, Murphy (Google/O'Reilly, 2016) — Cap 15: "Postmortem Culture: Learning from Failure".*
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: burn-rate-alerting
|
|
3
|
+
description: Use ao calcular burn rate predictive — lookahead/baseline window com fator 4×, context-aware vs short-term, fórmula de extrapolação para alert page vs ticket.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Observabilidade — Burn Rate Alerting
|
|
7
|
+
|
|
8
|
+
## Quando usar
|
|
9
|
+
|
|
10
|
+
LLM carrega esta skill ao configurar alertas SLO ou avaliar burn rate. Trigger phrases:
|
|
11
|
+
|
|
12
|
+
- "burn rate alert", "burn rate forecast"
|
|
13
|
+
- "lookahead window", "baseline window"
|
|
14
|
+
- "predictive vs context-aware"
|
|
15
|
+
- "quando paginar vs quando criar ticket"
|
|
16
|
+
- "extrapolar exhaustão de budget"
|
|
17
|
+
|
|
18
|
+
## Fórmula canônica
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
burn_rate = error_rate / (1 - SLO_target)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| Burn rate | Significado |
|
|
25
|
+
|---|---|
|
|
26
|
+
| 1× | Budget durará exatamente a janela do SLO |
|
|
27
|
+
| 2× | Budget acabará em metade da janela |
|
|
28
|
+
| 10× | Budget acabará em 1/10 da janela |
|
|
29
|
+
| 100× | Budget esgotado em horas, não dias |
|
|
30
|
+
|
|
31
|
+
**Predictive forecast (Cap 13 p145):**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
projected_remaining_at_lookahead = current_remaining - (burn_rate_now × lookahead_window)
|
|
35
|
+
ALERT iff projected_remaining_at_lookahead < 0
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Regras absolutas
|
|
39
|
+
|
|
40
|
+
- **Lookahead ≤ 4× baseline** — extrapolar 4 horas a partir de baseline 1h é confiável; extrapolar 1 dia a partir de 1h é flappy. (Sem ajuste de seasonality)
|
|
41
|
+
- **Sliding window 30d** para o SLO — alinha com customer memory (skill [`event-based-slos`](../skills/event-based-slos/SKILL.md))
|
|
42
|
+
- **2 alertas por SLO** — short-term (page) + long-term (ticket). Não 1 só, não 5+.
|
|
43
|
+
- **Short-term: lookahead 4h, baseline 1h** — paga on-call em horas
|
|
44
|
+
- **Long-term: lookahead 3d, baseline 18h** — abre ticket, não acorda alguém
|
|
45
|
+
- **Context-aware vs short-term** — escolher por trade-off de custo vs sensibilidade. Default short-term para a maioria; context-aware se "10% restante = mais urgente que 90%".
|
|
46
|
+
- **Não alertar zero-level** — se você só alerta quando budget = 0, não há tempo de reagir. Use predictive sempre.
|
|
47
|
+
|
|
48
|
+
## Patterns canônicos
|
|
49
|
+
|
|
50
|
+
### Pattern: 2 alertas canônicos por SLO
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
# PT-BR: para SLO 99.9% checkout_success com window 30d
|
|
54
|
+
slo: checkout_success
|
|
55
|
+
target: 0.999
|
|
56
|
+
window: 30d_sliding
|
|
57
|
+
|
|
58
|
+
alerts:
|
|
59
|
+
# PT-BR: PAGE — paginar on-call (urgent)
|
|
60
|
+
- name: short_term_burn
|
|
61
|
+
type: predictive
|
|
62
|
+
lookahead: 4h # PT-BR: forecast 4h à frente
|
|
63
|
+
baseline: 1h # PT-BR: 4× regra (4h ≤ 4× 1h ✓)
|
|
64
|
+
severity: page
|
|
65
|
+
threshold_burn_rate: 14.4 # PT-BR: 4h × 14.4 = ~58h, esgota budget de 30d×0.001 = 43.2min em <4h
|
|
66
|
+
routing: pagerduty:on-call
|
|
67
|
+
|
|
68
|
+
# PT-BR: TICKET — criar ticket Jira/Linear (não-urgent)
|
|
69
|
+
- name: long_term_burn
|
|
70
|
+
type: predictive
|
|
71
|
+
lookahead: 3d
|
|
72
|
+
baseline: 18h # PT-BR: 4× regra (3d ≤ 4× 18h = 72h ✓)
|
|
73
|
+
severity: ticket
|
|
74
|
+
threshold_burn_rate: 1.0 # PT-BR: 1× = vai esgotar em 30d se continuar
|
|
75
|
+
routing: jira:engineering
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Pattern: query de burn rate atual (Postgres)
|
|
79
|
+
|
|
80
|
+
```sql
|
|
81
|
+
-- PT-BR: burn rate atual em janela baseline (último 1h)
|
|
82
|
+
-- Para SLO 99.9% checkout_success
|
|
83
|
+
with baseline as (
|
|
84
|
+
select
|
|
85
|
+
sum(good) as good,
|
|
86
|
+
sum(bad) as bad,
|
|
87
|
+
sum(total) as total
|
|
88
|
+
from obs.sli_checkout_success
|
|
89
|
+
where bucket > now() - interval '1 hour' -- baseline window
|
|
90
|
+
)
|
|
91
|
+
select
|
|
92
|
+
total,
|
|
93
|
+
bad,
|
|
94
|
+
bad::float / nullif(total, 0) as error_rate,
|
|
95
|
+
(bad::float / nullif(total, 0)) / (1 - 0.999) as burn_rate,
|
|
96
|
+
case
|
|
97
|
+
when bad::float / nullif(total, 0) >= 0.0144 then 'PAGE' -- burn_rate ≥ 14.4
|
|
98
|
+
when bad::float / nullif(total, 0) >= 0.001 then 'TICKET' -- burn_rate ≥ 1
|
|
99
|
+
else 'OK'
|
|
100
|
+
end as alert_status
|
|
101
|
+
from baseline;
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Pattern: predictive forecast — esgotamento
|
|
105
|
+
|
|
106
|
+
```sql
|
|
107
|
+
-- PT-BR: ETA exhaustão do budget em horas
|
|
108
|
+
with current_state as (
|
|
109
|
+
select
|
|
110
|
+
sum(case when bucket > now() - interval '30 days' then bad else 0 end) as bad_30d,
|
|
111
|
+
sum(case when bucket > now() - interval '30 days' then total else 0 end) as total_30d,
|
|
112
|
+
sum(case when bucket > now() - interval '1 hour' then bad else 0 end) as bad_1h,
|
|
113
|
+
sum(case when bucket > now() - interval '1 hour' then total else 0 end) as total_1h
|
|
114
|
+
from obs.sli_checkout_success
|
|
115
|
+
)
|
|
116
|
+
select
|
|
117
|
+
-- PT-BR: budget restante em eventos
|
|
118
|
+
(1 - 0.999) * total_30d - bad_30d as remaining_budget,
|
|
119
|
+
-- PT-BR: taxa atual de queima (eventos/hora)
|
|
120
|
+
bad_1h::float / 1 as burn_per_hour,
|
|
121
|
+
-- PT-BR: ETA = budget restante / taxa
|
|
122
|
+
case
|
|
123
|
+
when bad_1h = 0 then 'NO_BURN'
|
|
124
|
+
else round(((1 - 0.999) * total_30d - bad_30d) / nullif(bad_1h, 0))::text || 'h'
|
|
125
|
+
end as eta_to_exhaustion
|
|
126
|
+
from current_state;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Pattern: context-aware vs short-term
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
SHORT-TERM (cheap):
|
|
133
|
+
- Olha apenas baseline window (último 1h)
|
|
134
|
+
- Não considera quanto budget já foi gasto
|
|
135
|
+
- Mais barato; default para maioria
|
|
136
|
+
- Pode causar false positive se budget está cheio (90% restante)
|
|
137
|
+
|
|
138
|
+
CONTEXT-AWARE (expensive):
|
|
139
|
+
- Considera budget remanescente
|
|
140
|
+
- "Remaining budget × tolerable_burn_rate ≥ lookahead × current_burn_rate"
|
|
141
|
+
- Mais caro (query SLO total + recente)
|
|
142
|
+
- Recomendado para SLOs de alto risco onde 10% restante > 90% restante
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Pattern: dashboard de burn rate (Markdown gerado por `/burn-rate-status`)
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
# Burn Rate Status — 2026-05-06 14:32 UTC
|
|
149
|
+
|
|
150
|
+
| SLO | Target | Window | Budget gasto | Burn rate atual | ETA exhaustão | Ação |
|
|
151
|
+
|---|---|---|---|---|---|---|
|
|
152
|
+
| checkout_success | 99.9% | 30d sliding | 23% | 1.4× | 12d | informativo |
|
|
153
|
+
| login_success | 99.95% | 30d sliding | 78% | 8.0× | 4h | **PAGE on-call** |
|
|
154
|
+
| search_latency | 99% | 30d sliding | 15% | 0.7× | — | OK |
|
|
155
|
+
| admin_panel | (sem SLO) | — | — | — | — | — |
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Pattern: tightening alerts gradualmente
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
SEMANA 1: SLO + alerts em test channel (não real page)
|
|
162
|
+
SEMANA 2: SLO + alerts em low-priority email
|
|
163
|
+
SEMANA 3-4: validar que SLO detecta incidents reais
|
|
164
|
+
SEMANA 5+: alerts SLO viram primários, threshold antigos para test channel
|
|
165
|
+
SEMANA 8+: deletar threshold antigos completamente
|
|
166
|
+
|
|
167
|
+
PT-BR: case study Honeycomb (Cap 12 p135) — SLO detectou outage 8h antes
|
|
168
|
+
de threshold tradicional alertar. Confiança = deletar antigos.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Anti-patterns
|
|
172
|
+
|
|
173
|
+
### ANTI: 1 alerta apenas (zero-level)
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
ANTI: alert dispara quando budget == 0 (totalmente exausto)
|
|
177
|
+
|
|
178
|
+
PROBLEMA: você não tem tempo de reagir. Budget zerou, SLO violado, cliente afetado.
|
|
179
|
+
|
|
180
|
+
CERTO: 2 alertas:
|
|
181
|
+
- Short-term: burn rate 14.4× → page (4h de runway)
|
|
182
|
+
- Long-term: burn rate 1× → ticket (3d de runway)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### ANTI: lookahead >> baseline
|
|
186
|
+
|
|
187
|
+
```text
|
|
188
|
+
ANTI: lookahead 1d a partir de baseline 1h (24×)
|
|
189
|
+
|
|
190
|
+
PROBLEMA: extrapolação linear de janela curta para janela longa é inválida.
|
|
191
|
+
Ciclos diários, semanais, sazonalidades distorcem.
|
|
192
|
+
Alert flappa (entra/sai a cada hora).
|
|
193
|
+
|
|
194
|
+
CERTO: lookahead ≤ 4× baseline (regra empírica do livro p145)
|
|
195
|
+
Para alertar 1d à frente: baseline ≥ 6h
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### ANTI: burn rate threshold = 1×
|
|
199
|
+
|
|
200
|
+
```text
|
|
201
|
+
ANTI: page on-call quando burn rate >= 1× (igual à taxa que esgota a janela)
|
|
202
|
+
|
|
203
|
+
PROBLEMA: 1× sustained durante 1 mês = budget zerou ao final.
|
|
204
|
+
Time tem 30d para reagir. NÃO é page-worthy.
|
|
205
|
+
|
|
206
|
+
CERTO: page = 14.4× (esgota em 4h, ação imediata)
|
|
207
|
+
ticket = 1× (esgota em 30d, ação planejada)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### ANTI: burn rate calculation com janela errada
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
ANTI: calcular burn rate sobre janela inteira de SLO (30d)
|
|
214
|
+
|
|
215
|
+
PROBLEMA: smooth out spikes recentes. Você vê "compliance ok 99.7%" mesmo
|
|
216
|
+
quando última 1h queimou 30% do budget. Reage tarde.
|
|
217
|
+
|
|
218
|
+
CERTO: burn rate sobre baseline window (1h ou 18h), comparado ao SLO inteiro
|
|
219
|
+
para avaliar remaining budget.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### ANTI: ignorar seasonality
|
|
223
|
+
|
|
224
|
+
```text
|
|
225
|
+
ANTI: alertar 1d à frente sem considerar que sábado tem 1/3 do tráfego
|
|
226
|
+
|
|
227
|
+
PROBLEMA: false positive sexta à noite (sábado vai ser baixo);
|
|
228
|
+
false negative segunda de manhã (sábado foi baixo, segunda explode).
|
|
229
|
+
|
|
230
|
+
CERTO: ou (a) usar baseline window grande o suficiente para capturar 1 ciclo
|
|
231
|
+
(≥ 24h cobre dia/noite; ≥ 7d cobre semana);
|
|
232
|
+
ou (b) modelar seasonality (cíclico) — context-aware burn alerts
|
|
233
|
+
que conhecem padrões.
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Verificação
|
|
237
|
+
|
|
238
|
+
Antes de promover burn alerts a produção:
|
|
239
|
+
|
|
240
|
+
1. **2 alertas por SLO** — short-term (page) + long-term (ticket)
|
|
241
|
+
2. **Lookahead ≤ 4× baseline** — verifique aritmética em cada
|
|
242
|
+
3. **Threshold burn rate calculado** — `target=99.9% → page=14.4×, ticket=1×`
|
|
243
|
+
4. **Routing nomeado** — `pagerduty:on-call` ou `jira:engineering`
|
|
244
|
+
5. **Test channel primeiro** — 1+ semana em low-priority antes de promover
|
|
245
|
+
6. **SLO já provou valor** — detectou incident antes de threshold antigo
|
|
246
|
+
7. **Documentação** — runbook de "o que fazer quando alert dispara"
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Ver também
|
|
251
|
+
|
|
252
|
+
- `kit/skills/_shared-observability/glossary.md` — burn rate, lookahead/baseline
|
|
253
|
+
- `kit/skills/event-based-slos/SKILL.md` — SLO definition
|
|
254
|
+
- `kit/skills/core-analysis-loop/SKILL.md` — investigar root cause após alert
|
|
255
|
+
- `kit/agents/burn-rate-forecaster.md` — agente que calcula via SQL
|
|
256
|
+
- `kit/commands/burn-rate-status.md` — comando que invoca forecaster
|
|
257
|
+
|
|
258
|
+
*Material-fonte: Observability Engineering (O'Reilly, 2022) — Cap 13: "Acting on and Debugging SLO-Based Alerts".*
|