In this lesson, you will learn how to maintain accurate, chronological records during an incident to facilitate precise post-mortem reconstruction and root cause analysis.
The Anatomy of an Incident Log
During a high-pressure incident, human memory is unreliable. To ensure an effective post-mortem, you must maintain a "Source of Truth" log that captures the lifecycle of the event. This log serves as the backbone for your blameless post-mortem, ensuring that you don't rely on anecdotes, but rather on a verifiable sequence of events.
An effective timeline log focuses on four specific categories:
- Detection: When the SLI first breached its target.
- Observations: Key metrics from Prometheus, logs from
kubectl logs, or alerts firing in your CI/CD pipeline. - Actions: Every command executed to mitigate or investigate (e.g.,
kubectl rollout undo, scaling a deployment, or changing traffic routes). - Communication: When stakeholders were notified and when the incident was declared resolved.
Best Practices for Logging
Avoid storing logs in ephemeral chat channels alone. Use a shared document or an incident management tool where entries include a timestamp, the actor, and the state of the system.
Example Incident Log Entry Format:
[14:02 UTC] Alert: High error rate (5xx) detected in `auth-service` via Grafana.
[14:05 UTC] Incident Commander assigned; Slack channel created.
[14:12 UTC] Observation: `kubectl get pods` shows `CrashLoopBackOff` in `auth-deployment`.
[14:15 UTC] Action: Inspected logs using `kubectl logs <pod-name>`. Found database connection timeout.
[14:20 UTC] Mitigation: Rolled back to previous image version `v1.2.3` using `kubectl set image`.
[14:25 UTC] Result: Error rates returning to SLO baseline.
By recording these events as they occur, you move away from guesswork. If an action was taken without a logged timestamp, it essentially "did not happen" in the eyes of your reliability audit. This disciplined approach allows your team to identify where the process broke down and how your SRE practices can be improved for future releases.
Key Takeaway: A comprehensive incident timeline must capture the exact timing of detections, observations, and mitigation actions to ensure a blameless and accurate reconstruction of the incident lifecycle.