Imagine a customer places an order in an e-commerce application, and the request takes five seconds to complete.
The application consists of multiple microservices:
You check the application logs, but nothing appears to be failing. Every service successfully processes its request.
So where are those five seconds being spent? Is the Order Service slow? Is the Inventory Service waiting for a database query? Is the Payment Service taking too long to communicate with an external provider?
Centralized logging helps you understand what happened inside individual services, but it doesn't automatically show how time was spent across the entire request. This is where distributed tracing becomes useful.
Distributed tracing tracks a request as it travels through multiple services, showing which services were involved, how they interacted, and how much time each operation took. It helps engineers understand the end-to-end behavior of distributed applications, especially when investigating slow requests and unexpected failures.