Distributed tracing

P37.metrics-traces.02 · Audience: guest, it-ml, language-pro · Prerequisites: Metrics & the three-pillars model

Real LLM grading for this pageLLM grading (this page):

A metric tells you a request was slow; a trace tells you which stage was slow. A trace is a tree of spans — one per unit of work, a root span for the whole request and a child span per stage — and reading that tree is how you find the bottleneck inside a single request. This module has you instrument a request pipeline and read its spans.

Step 1 / 3Spans and the trace tree
ⓘ Concept: A tree of timed work
A span is one timed unit of work with a name, a start and a duration. A request produces a root span with a child span per stage (auth, db, handler…). The tree's parentage and ordering are the "waterfall" a tracing UI draws.

Why it matters — Metrics say the request was slow; only the span tree says which stage ate the time — that is what makes a trace worth the instrumentation.

Ask the mentor about this module

Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.

Ctrl/Cmd + Enter to send

🎓 Practice ladder

1 graded rung · ~20 min

Instrument the provided request-pipeline simulator: read its span tree — the waterfall, the per-stage durations, and the slowest stage.

Rung 1 — read a trace: instrument the request pipeline

Loading exercise…

That is the three pillars end to end: structured logs to follow a request, metrics to alert on aggregates, and traces to find where the time went.