- ds
- Data display
- Trace waterfall
Trace waterfall
Spans of a request across services.
One request across services. Each row is a span: the work one service did, nested under the span that called it, with its bar on a shared time axis. Gaps between bars are waiting; long bars at the bottom of a chain are the cost.
Trace4bf92f3577b34da6
Duration482 ms
Spans10
1 error
- gateway
- checkout
- inventory
- payments
- postgres
- redis
- POST /v1/checkoutgateway
- CheckoutService.Placecheckout
- GET cart:8812redis
- Reserveinventory
- UPDATE stockpostgres
- Chargepayments
- Charge (retry 1)payments
- INSERT paymentpostgres
- INSERT orderpostgres
- DEL cart:8812redis
Show code
<div class="trace">
<div class="tr-head">
<span class="label">Trace</span><b>4bf92f3577b34da6</b> …
<ul class="ch-legend">…</ul>
</div>
<div class="tr-scale"><span>Service and operation</span>
<div class="tr-ticks"><span style="--at:0">0 ms</span><span style="--at:.2075">100 ms</span> …</div>
</div>
<ul class="tr-spans" role="listbox" aria-label="Spans">
<li class="tr-span s1" role="option" style="--d:0">
<span class="tr-name"><span>POST /v1/checkout</span><small>gateway</small></span>
<span class="tr-bar"><i style="--x:0;--w:1" data-v="482 ms"></i></span>
</li>
<li class="tr-span s4 err" role="option" aria-selected="true" style="--d:2">…</li>
</ul>
</div>The name column indents by depth with a guide for each level, and the dot and bar take the service colour, so a service reads the same in every row. A failed span is hatched red and its name turns red. Here the first payment charge timed out after 120 ms, and waiting for it and retrying cost 124 ms, a quarter of the request. Arrow keys move the selection.
| Class | On | What it does |
|---|---|---|
.trace | div | The frame. --nw sets the name column (16rem; 9.5rem on small screens). |
.tr-head | div | Trace id, duration, counts and the service legend. |
.tr-scale / .tr-ticks | div | The time axis. Ticks at --at, 0 to 1 of the trace. |
.tr-span | li | A row. Service colour from a series class, depth from --d. aria-selected highlights it, .err marks a failure. |
.tr-name | span | Operation in a span, service in small. |
.tr-bar > i | i | The span from --x for --w of the trace; data-v is the duration printed after it. |
Do
- Colour by service, not by depth or duration.
- Print every duration; widths alone mislead for short spans.
- Collapse subtrees of more than twenty spans by default.
Don't
- A log scale on the time axis.
- Hiding the gaps: waiting is often the finding.
Accessibility
- The spans are a listbox: one tab stop, arrow keys to move, Enter to open the span's details. Each option's text has the operation, service and duration.