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
  1. Instrument once with OpenTelemetry SDK/auto-instrumentation; export via OTel Collector.
  2. Metrics: counters (requests_total), histograms (request_duration_seconds buckets), gauges (queue_depth); scrape with Prometheus.
  3. Logs: structured, include trace_id; ship via Fluent Bit/Vector to Loki/Elasticsearch.
  4. Traces: propagate context across HTTP/gRPC/Kafka headers; sample 1-10% head-based, or tail-sample errors/slow.
  5. Dashboards per service with RED; per resource with USE. Alerts on SLO burn rate → PagerDuty; runbooks linked.

Trade-offs#

ChoiceProCon
MetricsCheap, fast queries, great for alertingPre-aggregated; limited cardinality
LogsArbitrary detail, searchableExpensive at volume; noisy
TracesShows where time went across servicesSampling loses rare cases; instrumentation effort
Head samplingSimple, low overheadMight drop the interesting slow/error traces
Tail samplingKeep errors and slow tracesNeeds buffering collector; more infra
Alert on causes (CPU 80%)Early warningPager fatigue, false positives
Alert on symptoms (SLO burn)Only wakes you for user impactNeeds 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#

See also