CONCEPT SHEET · Concepts
Observability
One-liner: Logs, metrics, and traces tied together by correlation IDs so you can ask new questions about production without shipping new code.
ArticleConcepts© Arthur Bernier Jr783 words2 code blocks
Say this#
How it works#
TEXT
request -> gateway assigns trace_id -> svc A (span) -> svc B (span) -> DB (span) | | | logs{trace_id} metrics{service,route,status} traces -> Jaeger/Tempo
- Instrument once with OpenTelemetry SDK/auto-instrumentation; export via OTel Collector.
- Metrics: counters (requests_total), histograms (request_duration_seconds buckets), gauges (queue_depth); scrape with Prometheus.
- Logs: structured, include
trace_id; ship via Fluent Bit/Vector to Loki/Elasticsearch.
- Traces: propagate context across HTTP/gRPC/Kafka headers; sample 1-10% head-based, or tail-sample errors/slow.
- Dashboards per service with RED; per resource with USE. Alerts on SLO burn rate → PagerDuty; runbooks linked.
Trade-offs#
| Choice | Pro | Con |
|---|
| Metrics | Cheap, fast queries, great for alerting | Pre-aggregated; limited cardinality |
| Logs | Arbitrary detail, searchable | Expensive at volume; noisy |
| Traces | Shows where time went across services | Sampling loses rare cases; instrumentation effort |
| Head sampling | Simple, low overhead | Might drop the interesting slow/error traces |
| Tail sampling | Keep errors and slow traces | Needs buffering collector; more infra |
| Alert on causes (CPU 80%) | Early warning | Pager fatigue, false positives |
| Alert on symptoms (SLO burn) | Only wakes you for user impact | Needs well-defined SLIs |
Numbers#
- Common SLO alert pair: 2% budget burn in 1 h (page) and 5% in 6 h (ticket); burn rate 14.4x and 6x for a 30-day 99.9% SLO.
- Trace sampling in production: 1-10% head-based is typical; 100% for low-traffic services.
- Prometheus scrape interval: 15-60 s; retention days-weeks locally, long-term in Thanos/Cortex/Mimir.
- Latency histogram buckets: use p50/p95/p99 from histograms, not averaged percentiles.
In the interview#