View and Search Traces in Jaeger, Hands-On
A teammate says checkout felt slow a few minutes ago. The shop now records every request as a trace, so the evidence is there: hundreds of traces in Jaeger. The hard part is finding the few that matter and reading them. This lesson covers Jaeger's search form, the trace timeline and the views beyond one trace, then answers the teammate's question.
The search form: which traces to fetch
Jaeger is where finished traces end up: the Collector exports them, Jaeger stores them, and its UI on port 16686 searches and draws them. The lab's Jaeger from lesson 12 keeps up to 100,000 traces in memory, so a restart empties it.
The form on the left of the Search page builds the query. Jaeger 2.23 uses OpenTelemetry names, so where older guides say Operation and Tags, you see Span Name and Attributes:
- Service: the app's
service.name, hereshop-demo-otelfrom lesson 14. - Span Name: All, or one span name such as
GET /checkoutorpayment.charge. - Attributes:
key=valuepairs in logfmt, a plain text format. A space means AND, and a value with spaces goes in quotes. - Lookback: how far back to search, by default the last hour.
- Min Duration and Max Duration: written like
500msor1.2s. - Limit Results: the most traces to return, 20 by default.
Two rules surprise most people. First, the filters test single spans: a trace matches when one of its spans passes them all. With Span Name All, Min Duration 500ms finds any trace with some span of 500 ms or more. Pick GET /checkout instead, and the request span itself must take that long.
Second, in this lab's in-memory store, Limit Results keeps the newest matches. Sorting afterwards only reorders those 20; it does not fetch the 20 longest.
The sketch labels each part of the page. Callouts 4, 5 and 6 are the two rules above.
Find Traces fills the right side: a scatter plot with one dot per trace (start time across, duration up, bigger dots for more spans), then one row per trace with its duration, span count and any error count, such as 2 Errors. Click a row to open that trace.
Reading one trace: the timeline and the span details
A trace opens in the Trace Timeline, Jaeger's waterfall. As What Is Distributed Tracing? explained, each row is a span, indented under its parent, and each bar shows when its span started and how long it took. The header sums up the trace: Trace Start, Duration, Services, Depth (levels of nesting) and Total Spans.
Read it with that lesson's questions: which bar is longest, is its time its own or its children's, and where are the gaps? A parent's time includes its children's, so the root, the span with no parent, is always long. You want the span whose own work is long.
Click a row to open its details. You see Service, Duration and Start Time, which is measured from the start of the trace, then collapsible sections. Attributes holds the span's key-value pairs, such as shop.order.id. Resource describes the app, such as service.name. Events, called Logs in older versions, are timestamped notes. A failed payment has one named exception.
A span with status Error has an exclamation-mark icon by its name, and a hollow icon on a parent means only a child failed. In a failed checkout, payment.charge and GET /checkout both carry the full icon. Below is a slow checkout from the lab: notice the bar that fills almost the whole trace.
Finding the slow, the failing and the different
For slow requests, set Min Duration, then set the results' Sort to Longest First. The same menu can also sort by Most Errors.
For failed requests, type error=true under Attributes. Here error is a special key: Jaeger checks it against each span's status, so it finds spans marked Error even though no attribute called error exists.
To compare two traces, tick the checkbox on two result rows and click Compare Traces. The view merges both into one graph, with one node per service and span name. A node that appears more often in one trace gets a + or − count and a percentage. It compares shape, not timing. That makes it the tool for "the slow one made 50 queries instead of 5".
Two lab checkouts have the same four spans, so every node matches. To compare their timings, open the slow trace and a normal one in two browser tabs and read the same bar in each.
System Architecture in the top bar draws the dependency graph: a node per service, and an arrow from caller to callee wherever a span's parent belongs to another service. With in-memory storage, Jaeger builds it from stored traces on request; the Jaeger FAQ says stores such as Elasticsearch need a separate Spark or Flink job to compute it.
In this lab the page says No service dependencies found. That is correct: shop-demo-otel calls no other traced service, and its SELECT span comes from SQLite inside the same app.
Which step makes /checkout slow?
Now the teammate's question: checkout is sometimes slow, but which step is to blame? The flowchart is the routine. Mind the loop: a long bar whose children fill its time only contains the delay, so follow the time down until no child explains it.
First you need traffic. The lab folder has a new script, generate-traffic.sh. It sends 50 rounds of four checkouts and two product lists at a time, plus five reports, then counts the failed checkouts. Its output, trimmed:
$ ./generate-traffic.sh
Sending 50 rounds of requests to http://localhost:8001 ...
round 10 of 50 done
Done: 305 requests, 200 of them GET /checkout; 6 checkouts failed with HTTP 500.
The failure count is random, about 3% of checkouts, and about 5% are slow. If nothing answers on port 8001, the script stops and says how to start the app.
In a slow trace, inventory.lookup with its SELECT takes under 60 ms. payment.charge takes 0.8 to 1.2 s and has no children, so that time is its own; in normal checkouts it takes 50 to 200 ms. The slow checkouts wait on the payment provider, not the inventory.
Check yourself
Yesterday a checkout took 9 seconds. You search the last 2 days with Min Duration 500ms and Sort Longest First, and the top result is 1.3 s. Does that prove the 9-second trace is gone?
No. The search returned only the newest 20 matches, and sorting reordered those 20. Search with Min Duration 5s or raise Limit Results. In this lab, also check that Jaeger has not restarted since then.
GET /checkout takes 1.1 s and its child payment.charge 1.04 s. A teammate blames the Flask request handler, because the root is the longest span. What is wrong?
The root's time includes its children's, and inventory.lookup and payment.charge fill nearly all of it. payment.charge has no children, so its second is its own work. That is the step to look at.
Compare Traces shows every node the same for a slow and a fast checkout. Did both requests do the same thing at the same speed?
Same work, not the same speed. Compare counts spans per service and span name and ignores durations. Same shape means the slow one made no extra calls: one step just took longer, which the timelines show.
Go deeper
- NGINX Jaeger Tracing: adds a traced NGINX proxy in front of an app, so Jaeger shows the proxy's time too. It uses OpenTracing, a forerunner of OpenTelemetry.