Course contentsShow
← Cloud and Infrastructure
Lesson 2060 of 2,98944. Observability - TracingFree lesson

What is Distributed Tracing

Understanding traces, spans, and how they represent requests flowing through distributed systems.

What is Distributed Tracing

What you'll learn: How distributed tracing tracks requests as they flow through multiple services in cloud-native systems.

The Problem with Distributed Systems

In modern cloud infrastructure, a single user request might touch dozens of microservices—authentication, billing, inventory, notifications, and more. When something goes wrong or performs slowly, logs from individual services can't easily show you the complete journey. You need a way to follow that request's entire path across service boundaries.

Understanding Traces, Spans, and Request Flow

Distributed tracing creates a complete picture of how requests move through your system by tracking them across all services involved.

Think of it like tracking a package through the postal system. The package (your request) gets a unique tracking number when it enters the system. As it moves through each facility—sorting center, regional hub, delivery truck—each stop is recorded with timestamps. At the end, you can see the entire journey and identify where delays occurred.

Core Concepts

Traces represent the entire lifecycle of a request through your distributed system. Each trace has a unique ID that follows the request everywhere.

Spans are the individual operations within a trace. When Service A calls Service B, that's one span. When Service B queries a database, that's another span. Each span records:

  • Operation name
  • Start and end timestamps
  • Parent-child relationships with other spans
  • Metadata (tags, logs, service name)

Spans form a tree structure showing which operations triggered which others, with timing information at every step.

Why It Matters

Without tracing, debugging a slow request means checking logs across multiple services, trying to correlate timestamps manually. With tracing, you instantly see which service took too long and where bottlenecks exist.

Key Takeaway: Distributed tracing uses traces (complete request lifecycles) and spans (individual operations) to visualize how requests flow through distributed systems, making it possible to diagnose performance issues and failures across service boundaries.