Lesson 13 of 13 · 14m
You Cannot Grep a Distributed System
A request spanning forty services needs a propagated trace context, not forty log streams — and users live at p99, where one slow dependency hits most of them.
A request that touches forty services produces forty log streams on forty machines, each with its own clock. "Check the logs" now means reconstructing causality across forty unsynchronized timelines by hand. The unit of debugging in a distributed system is the trace — a DAG of spans that records what called what — not the log line.
Context has to be carried
Traces work because every hop propagates context. The W3C standard is traceparent: 00-<32-hex-trace-id>-<16-hex-parent-span-id>-<flags>, optionally joined by tracestate and baggage for cross-vendor metadata. OpenTelemetry wraps this in SpanContext; Zipkin's B3 headers (X-B3-TraceId and friends) are the legacy you will still meet in the wild. Drop the header on one egress hop and the trace splits into two disjoint trees — which is why propagation is a checklist item for every new HTTP client, queue producer, and message consumer, not an instrumentation nicety. Logs do not disappear: they get trace_id fields so a log line joins its trace (Logback MDC's %X{traceId} is the JVM spelling of that idea), and structured logging finally earns its keep.
The Dapper paper (Google, 2010) is the intellectual parent here, and its observation holds: in a system with real fan-out, the interesting questions — which service ate the budget, where did the retry happen — are causal questions, and causality is exactly what timestamps cannot give you across machines. That is the clock lesson coming home.
Metrics and traces also connect, and the link has a name: exemplars. A Prometheus histogram can carry a trace ID on the observations that populated each bucket, so the p99 spike in the dashboard links straight to the slow traces that caused it. The loop closes — metric says something is wrong, exemplar says which requests, trace says which span ate the budget.
The tail is where your users live
Dean & Barroso's "The Tail at Scale" (CACM 2013) put the number on it. Suppose each backend call is "slow" at p99 — one request in a hundred. A user request that fans out to 100 calls contains a slow call with probability 1 − 0.99^100 ≈ 63%. At fan-out 1000, essentially every user request contains a tail event. The p50 latency you monitor is a fiction your users never experience; percentiles are the product.
The mitigations the paper catalogs are worth knowing as mechanisms, not vibes. Hedged requests: send a second identical request when the first passes its p95 mark — cheap insurance that requires the operation to be idempotent, which is why the idempotency lesson matters to latency too. Micro-partitioning keeps one slow shard from poisoning a replica pool. Latency-aware load balancing routes around a node whose tail is drifting before its error rate notices.
The wrong mental model
"Average latency is the experience" — it is the experience of a user who does not exist. "More logs is more observability" — more unindexed streams is more grep surface. The tools that answer production questions are traces for causality, percentile SLIs for user experience, and error budgets for "is this worth waking someone up." A 5xx rate alert without a budget attached is an anxiety generator; a budget burn rate is a decision.
What to actually do
Propagate traceparent on every egress call — HTTP, queue publish, consumer receive — and put trace_id in every log line. Sample deliberately: head-based sampling for volume, tail-based for errors and slow traces, because the one request you want is the one that broke the budget. Monitor p50/p95/p99 per endpoint, not per service average. Define SLOs with error budgets and alert on burn rate. And when the p99 graph regresses, read the trace DAG: the answer to "where did the budget go" is a span name, not a stack of log files.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
What is Platform as a Service? The Sweet Spot Between "Too Easy" and "Too Much Work"
Platform as a Service sits between raw servers and fully managed software. You push code, the platform runs it. No Nginx config, no OS patches, no 3 AM server alerts. Here is what PaaS actually gives you, what it costs you in control, and how to decide if it is the right layer for your application.
The World now is Serverless and Container based
A new report from Datadog reveals that serverless computing could be entering the mainstream. This has already been the case in my world for the past few years. Results show that more than half of all organizations are using serverless on one of the three major public cloud providers: Amazon,
AWS Emulator Puts AWS on Your Laptop. Keep Your IAM Tests Off It.
AWS released AWS Emulator on November 11, a free local server that answers AWS API calls on 127.0.0.1 with per-run keys and fresh certificates.
A 257-Byte Password Is the Key: Inside the OpenSSH musl Bypass
CVE-2026-123158 lets an attacker log into a locked account on musl-based systems like Alpine by sending a password nobody set. The trigger is one number, 257, and the reason is a C library returning a single asterisk. I reproduced the exact boundary against musl 1.2.4 and read the fix.