Observability & Monitoring
Logs, metrics, and traces — correlation IDs, OpenTelemetry, Prometheus, Grafana, and Jaeger.
The three pillars
One user request now crosses ten services. When it fails, no single log file tells the story. Observability rests on three complementary signals:
- Logs — discrete structured events ('what happened here'). Ship JSON logs to a central store (ELK/Loki).
- Metrics — cheap numeric aggregates over time ('how much/how fast'). Prometheus scrapes, Grafana visualizes, alerts fire on symptoms.
- Traces — the journey of one request across services ('where did the time go'). Jaeger/Tempo visualize spans.
Correlation and context propagation
The glue is context propagation: the edge assigns each request a trace/correlation ID, and every service passes it onward (W3C traceparent header) and stamps it into every log line. Given one failing request you can pull its complete cross-service story.
{
"ts": "2026-07-11T09:31:04.221Z",
"level": "error",
"service": "payment-service",
"traceId": "4bf92f3577b34da6",
"spanId": "00f067aa0ba902b7",
"orderId": "ord_42",
"msg": "charge declined",
"declineCode": "insufficient_funds"
}Distributed tracing mechanics
A trace is a tree of spans. Each span records an operation (HTTP call, DB query) with start time, duration, attributes, and its parent span. OpenTelemetry is the vendor-neutral standard: SDKs auto-instrument common frameworks, a collector receives spans, and you export to Jaeger, Tempo, or a SaaS backend.
Reading a trace waterfall answers instantly what hours of log-grepping cannot: which hop was slow, what ran serially that could parallelize, where the error originated.
What to measure: RED and the four golden signals
For every service, dashboard the RED metrics: Rate (requests/s), Errors (failure rate), Duration (latency percentiles — p50, p95, p99; never averages, they hide pain). Google's SRE book adds saturation (how full are your resources).
Alert on user-facing symptoms (error rate, p99 latency, SLO burn rate), not on causes (CPU%) — causes page you at 3am for things users never noticed.
Key takeaways
- Logs, metrics, traces — each answers a different question; you need all three.
- Propagate trace/correlation IDs everywhere and stamp them into structured logs.
- OpenTelemetry is the vendor-neutral instrumentation standard.
- Dashboard RED (rate, errors, duration percentiles); alert on symptoms, not causes.
Knowledge check
A request fails somewhere across 8 services. Which signal locates the failing hop fastest?
Why alert on p99 latency rather than average latency?
What role does the OpenTelemetry Collector play?