23 / 25 · Operations and recovery

Distributed tracing

Distributed tracing follows one operation across multiple components using linked spans and propagated context. It helps locate time and errors, but traces are sampled evidence, not proof that every request behaved the same way.

What you will practise

  • Trace one request
  • find the critical path
  • protect telemetry data

Before you start: Request duration, span and parallel work.

About 5 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand distributed tracing. A parcel carries a tracking number through several delivery centres. Each centre records when its part began and ended. You can find where this parcel waited. That does not mean every parcel took the same path, and missing a tracking scan does not prove the parcel disappeared. Distributed tracing follows one operation across multiple components using linked spans and propagated context. It helps locate time and errors, but traces are sampled evidence, not proof that every request behaved the same way.

Follow the normal path. The gateway starts or receives trace context for checkout. Its span represents one part of the operation, not all system traffic. Booking receives compatible context and creates a related span. Without propagation, downstream records can appear as unrelated operations. SeatSpot checkout passes through gateway, booking, database and payment. One total latency number cannot show which hop waited or whether two operations ran in parallel.

Now change one condition. Database and payment calls run in parallel in this teaching example. Their intervals overlap, so adding both durations would overstate wall-clock time. A common misunderstanding is this: A sampled trace proves every request behaved the same way. Sampling selects evidence, not every operation. Missing context also creates incomplete traces. Think about this. A 100 ms database call overlaps a 300 ms payment call, with 40 ms overhead. Is total duration necessarily 440 ms? Pause the video and make your prediction. No. In the simplified parallel example it is about 340 ms. Inspect overlap and missing time rather than summing every child span.

Let us reason with a concrete example. Checkout has a 100 ms database call and a 300 ms provider call in parallel, plus about 40 ms sequential overhead. A simplified total is about 340 ms, not 440 ms. Actual scheduling, serialization and network effects require measured traces. Investigate the critical path and compare slow traces with broader metrics. Do not optimize a fast database span just because it is easiest to see. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. Instrumentation exports spans to an observability backend. Export buffering, sampling and failures mean a trace view is not a complete audit of every request. Compare the critical path, errors and dependency waits. Combine traces with aggregate metrics to determine whether the visible slow request reflects a widespread problem. When you try the practice task, look for this result. Parallel work overlaps in wall-clock time; sampled traces must be compared with aggregate metrics.

Check your understanding. Do not attach secrets or unnecessary personal data to spans. Keep attribute cardinality, access, sampling and retention within a deliberate observability budget. Here is a challenge. Two 200 ms spans run in parallel inside a 250 ms request. Is the request necessarily missing 150 ms? Pause before the answer. No. Parallel spans overlap, so their sum can exceed wall-clock request duration. Inspect start/end times and the critical path before inferring missing time. For an interview, discuss context propagation, critical paths and useful attributes. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A parcel carries a tracking number through several delivery centres. Each centre records when its part began and ended. You can find where this parcel waited. That does not mean every parcel took the same path, and missing a tracking scan does not prove the parcel disappeared.

Why SeatSpot needs this

SeatSpot checkout passes through gateway, booking, database and payment. One total latency number cannot show which hop waited or whether two operations ran in parallel.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

Gateway spanBooking spanDB spanPayment spanTrace collector

Step 1 of 6 · One causal request path

Start one operation

The gateway starts or receives trace context for checkout. Its span represents one part of the operation, not all system traffic.

Read all six mechanism steps
  1. Start one operation

    The gateway starts or receives trace context for checkout. Its span represents one part of the operation, not all system traffic.

  2. Propagate context

    Booking receives compatible context and creates a related span. Without propagation, downstream records can appear as unrelated operations.

  3. Record parallel work

    Database and payment calls run in parallel in this teaching example. Their intervals overlap, so adding both durations would overstate wall-clock time.

  4. Collect span evidence

    Instrumentation exports spans to an observability backend. Export buffering, sampling and failures mean a trace view is not a complete audit of every request.

  5. Find the slow boundary

    Compare the critical path, errors and dependency waits. Combine traces with aggregate metrics to determine whether the visible slow request reflects a widespread problem.

  6. Protect telemetry data

    Do not attach secrets or unnecessary personal data to spans. Keep attribute cardinality, access, sampling and retention within a deliberate observability budget.

Pause and make a prediction

A 100 ms database call overlaps a 300 ms payment call, with 40 ms overhead. Is total duration necessarily 440 ms?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: A sampled trace proves every request behaved the same way.

Better explanation: Sampling selects evidence, not every operation. Missing context also creates incomplete traces.

Draw a trace timeline

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. Draw database from 20 to 120 ms.
  2. Draw payment from 20 to 320 ms on a second row.
  3. Add sequential overhead and identify the critical path.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

Two 200 ms spans run in parallel inside a 250 ms request. Is the request necessarily missing 150 ms?

Check one key idea

Two child spans overlap. Their durations:

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.