Design Application Logs for Fast Incident Diagnosis
8 steps · about 3 h 40 min · Intermediate
- Place logs among observability signals (guide, OpenTelemetry, 25 min)
Understand how event records complement traces and metrics during diagnosis.
- Adopt a structured log model (reference, OpenTelemetry, 30 min)
Represent timestamp, severity, body, resource and attributes consistently across services.
- Use semantic log attributes (reference, OpenTelemetry, 25 min)
Choose stable field names so queries can work across libraries and components.
- Add application context (guide, OpenTelemetry, 30 min)
Instrument a small service and attach useful resource and request attributes.
- Correlate logs with traces (reference, OpenTelemetry, 20 min)
Carry trace and span identifiers so one request can be followed across boundaries.
- Protect log content (guide, OWASP Cheat Sheet Series, 35 min)
Exclude secrets and unsafe personal data while preserving security-relevant events.
- Understand severity conventions (reference, IETF, 25 min)
Use standard severity levels and structured data without treating every event as an error.
- Test diagnosis with a failure (guide, OpenTelemetry, 30 min)
Trigger a controlled fault and confirm the records answer what failed, where, for whom and along which request path.