CS PAPERS DEEP-READ · PAPER 26

Dapper: Large-Scale Distributed Systems Tracing

Sigelman et al. · Google · Technical Report 2010

中文 →

What did this paper do?

In 2010, Google published its internal tool Dapper. When you type a search or click "buy," hundreds or thousands of machines hand off work behind the scenes. Before Dapper, if that one request got slow or went wrong, nobody could say which machine, which step was the culprit. Dapper issues each request a "travel record" for its whole journey, stitching together every service it passed through and how long each stop took. Today every system that talks about "observability" or "distributed tracing" — Zipkin, Jaeger, OpenTelemetry — is built in Dapper's image.

The old world's pain

A single request at a big company hasn't been "one server computes and returns" for a long time. You search a word, and the frontend fans it out at once to dozens of backends: one for web pages, one for images, one for ads, one for spelling correction… and each backend asks a whole chain of services beneath it. Spread out layer by layer, one request can touch thousands of machines. Here's the problem: the whole thing was 100 ms slow — who dragged it down? The engineer who owns the frontend can't see inside the backends; the person who owns some backend doesn't know who called them or where in the chain they sit. Everyone holds one small piece of the puzzle, and no single person can see the whole of one request — which is fatal when you're debugging an outage.

That "travel record"

Dapper's idea: give every incoming request a unique ID, then make that ID travel with the request the whole way — wherever the request goes, the ID goes too. Each stop notes down "what time I received it, what time I finished, and who called me." Afterward you gather all the records sharing that same ID and reassemble a complete call tree: who called whom, how long each segment took, which branch was slow — all at a glance. Like slapping one unified tracking barcode on a form as it winds through a dozen departments.

Two clever moves make it work. First, engineers barely change their own code: every service at Google uses the same underlying communication libraries, so Dapper put its recording code inside those shared libraries — and every service got traced "for free." Second, don't record everything — sample: the request volume is enormous, so recording each one would slow the system and cost too much to store. Dapper keeps a full record only about once every thousand-plus requests — for high-traffic systems that tiny sample is plenty to see the patterns, at a cost small enough to ignore.

So how does it actually help?

With a full travel record, things that used to be guesswork become directly visible: open the call tree of a slow request and you see whether some downstream service stalled or the network wait was long; want to know "which other services does mine actually depend on?" — aggregate a mass of records and the dependency map draws itself; chasing a bizarre bug across a dozen teams no longer means meeting each team to line up timelines — lay out one trace and it's clear which segment is to blame. It turns "the distributed system is a black box" into "something you can click open, layer by layer."

An honest note: sampling cuts both ways. It's great for massive traffic, but if the very thing you're chasing is a rare failure that shows up once in ten thousand times, that one occurrence probably wasn't sampled and left no record — later tracing systems added a "record everything first, then decide what to keep once something looks off" approach to patch this.

Remember one thing

Give every request an ID that travels with it, automatically record each stop and its timing inside the shared communication libraries, and reassemble a call tree afterward — so with no code changes from engineers and near-zero overhead via sampling, you can see exactly which path one request took across thousands of machines and where it got slow. This "trace / span / context-propagation" model became the blueprint for every distributed-tracing and observability system today.

Want the call-tree diagram, the collection pipeline, and the overhead numbers? → switch to the deep read