Lesson 6 of 9 · 24m
Flag Observability and Incident Response
Connect evaluation telemetry, audit logs, metrics, traces, and runbooks so flag-caused incidents can be diagnosed and reversed quickly.
When a flag causes an incident, the first question is never philosophical. It is who changed what, when, and which users are still seeing it? If the answer requires Slack archaeology, vendor dashboards, and guessing which service caches evaluations, the incident will last longer than the rollout did. Observability is part of the flag feature.
Audit every control-plane change
The audit record needs actor, key, before, after, reason, and source:
{
"actor": "oncall@sudosecurity.org", "key": "ingest.enrich-with-llm",
"environment": "production", "before": true, "after": false,
"reason": "worker saturation incident INC-4821",
"changed_at": "2026-11-30T14:11:03Z", "source": "console"
}Include evaluation in traces and error reports
You do not need every flag in every span. You do need the flags that alter the behavior being observed:
span.set_attribute("flag.checkout.payment-orchestrator", "true")
span.set_attribute("flag.checkout.payment-orchestrator.rule", "tenant-20pct")
span.set_attribute("flag.checkout.payment-orchestrator.version", 18)Keep high-cardinality user identifiers out of metrics. Traces can carry controlled context; aggregate metrics should use low-cardinality labels such as variation, rule, platform, and environment.
Dashboards compare exposed and unexposed cohorts
For every significant rollout, watch the same core metrics split by variation:
p50/p95 latency by variation
error rate by variation and platform
business conversion by variation where applicable
resource consumption workers, DB CPU, queue depth
correctness counters reconciliation mismatches, retries, dead lettersA lift in conversion does not excuse a doubling of database CPU. Conversely, a flat product metric does not prove the rollout is safe if mutation errors are rising.
Alerts should notice stuck states
Alert on more than crashes:
- operational flag active longer than its incident window
- rollout unchanged while error budget burn increases
- evaluation failure rate or fallback rate above baseline
- old-path traffic after announced cutover completion
Stale state is often the real failure. The system is not exploding; it is quietly remaining halfway through a transition.
Write the incident runbook before exposure
A one-page runbook should say who can disable the flag, what off means, how long propagation takes, what caches or clients lag, what data needs reconciliation, and how to communicate degradation. During the incident, people execute; they do not design distributed-systems semantics under pressure.
Field notes
- Never log raw targeting attributes if they include sensitive data; log cohort labels and stable hashes instead.
- If customer support cannot tell whether a user is in a rollout, expect confusing bug reports and contradictory screenshots.
Was this lesson helpful?