Instrumenting for distributed tracing
Traces track the progression of a single activity in an application. For example, an activity can be a user making a request in your application. If a trace only tracks the progression of that activity in a single process or a single component of a system composed of many components, its value is limited. However, if a trace can be propagated across multiple components in a system, it becomes much more useful. Traces that can propagate across components in a system are called distributed traces. Distributed tracing and correlation of activities is a powerful tool for determining causality within a complex system.
A trace is composed of spans that represent units of work within an application. Each trace and span can be uniquely identified, and each span contains a context consisting of Request
, Error
, and Duration
metrics. A trace contains a tree of spans with a single root span. For example, imagine a user clicking on the checkout button on...