Observability Architecture
Design observability systems: structured logging, distributed tracing, metrics collection, alerting strategies, SLO/SLI frameworks, and incident response procedures.
Guiding Principle
"Observability is the ability to understand internal system state from external outputs — not just knowing something is broken, but understanding why."
Procedure
Step 1 — Three Pillars Design
- Design structured logging: format (JSON), fields (trace_id, service, level, context), sampling
- Design distributed tracing: instrumentation strategy, context propagation, sampling rate
- Design metrics collection: RED (Rate, Errors, Duration) for services, USE (Utilization, Saturation, Errors) for resources
- Define correlation strategy: linking logs, traces, and metrics via trace_id and span_id
- Select observability backend: Prometheus + Grafana, Datadog, or OpenTelemetry Collector
Step 2 — SLO/SLI Framework
- Identify critical user journeys for SLI measurement
- Define SLIs per journey: availability, latency, correctness, freshness
- Set SLO targets: e.g., 99.9% of requests complete in <500ms over 30-day window
- Calculate error budgets and burn rate alerting thresholds
- Design SLO dashboards showing budget consumption rate and trend
Step 3 — Alerting Strategy
- Define alerting tiers: P1 (page), P2 (ticket), P3 (log review), P4 (informational)
- Design alert routing: on-call schedules, escalation paths, team ownership
- Implement symptom-based alerting (SLO burn rate) instead of cause-based
- Define alert quality metrics: signal-to-noise ratio, MTTA, time-to-acknowledge
- Establish alert review cadence: weekly review of noisy/ineffective alerts
Step 4 — Incident Response
- Define incident severity levels with clear criteria and examples
- Design incident workflow: detection, triage, mitigation, resolution, postmortem
- Implement runbook automation for common incident types
- Design postmortem process: blameless, action-item tracking, pattern analysis
- Build incident metrics dashboard: MTTD, MTTA, MTTR, incident frequency
Quality Criteria
- Every service emits structured logs, traces, and RED metrics
- SLOs defined for all critical user journeys with error budget tracking
- Alert signal-to-noise ratio >80% (alerts that lead to action)
- Postmortem completed for every P1/P2 incident within 5 business days
Anti-Patterns
- Logging everything at DEBUG level in production (cost and noise)
- Alerting on every metric threshold instead of SLO burn rate
- Tracing at 100% sample rate in high-throughput systems (cost explosion)
- Postmortems that assign blame instead of improving systems