

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Tracing
incomplete
2: Installing Jaeger
incomplete
3: Request Tracing
incomplete
4: Instrumenting Traces
incomplete
5: Adding Spans
incomplete
6: Reading Traces
incomplete
7: Distributed Tracing
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Let's build a conceptual understanding of traces in OpenTelemetry.
Click to play video
A trace represents a single "request". "Request" is loosely defined, but typical examples include:
A trace has a unique ID, and a tree of spans...
A trace is made up of spans. You can think of a span as a stack frame in a stack trace, though the correlation is imprecise because spans can be defined arbitrarily, not only at function boundaries.
Each trace has at least one span, the "root span". Typically, a root span has one or more child spans, which in turn may have grandchild spans, to an arbitrary depth.
Each span has:
"HTTP GET /login")Spans may contain an arbitrary set of key/value pairs known as attributes. These are conceptually similar to the key/value pairs we send to logs in earlier chapters.
http.method=POST
http.route=/login
user.id=1234
Events are timestamped annotations on a span. They indicate the instant something noteworthy happened within a span. While we won't be exploring events fully in this course, it's important to know that they exist.
Finally, each span has a status. By default, each span's status is UNSET, but you can explicitly set a span's status to either OK or ERROR as well. This three-valued system allows you to indicate that specific spans (or operations) within a larger request failed, without failing the entire operation.
Trace 123
├── Span A: HTTP handler (OK)
│ ├── Span B: load user (OK)
│ ├── Span C: apply coupons (ERROR)
│ └── Span D: write audit (OK)
└── ...