Four teams, one slow checkout — traces, spans and time-to-culprit
Logs and dashboards are both recorded per service, so neither can say which hop of one request consumed the time — one record per hop of that single request, tied together, makes the slow hop name itself.
Scene 01
Four teams, one slow checkout
- Watch
- Try it
- Predict
- Capture
Where did the time go? A customer's checkout took 3 seconds instead of 200 milliseconds, and four teams each swear their own service is fast. Watch the same slow checkout investigated three ways — first the teams' logs, then their dashboards, then the request recorded hop by hop — and watch the clock in the corner, which counts the minutes until someone can name the service responsible.
Highlighted lines are the ones running in the diagram right now.
def walk(checkout, path):for service in path:start = service.clock()service.handle(checkout)taken = service.clock() - startservice.own_log.append(line(start, taken))service.own_numbers.record(taken)hops_of(checkout).append(hop(service, start, taken))
def find_slow_hop(checkout, path):if how == 'logs':for service in path:lines = read(service.own_log)guess_by_timestamp(lines, checkout)return cannot_sayif how == 'dashboards':for service in path:read(service.own_numbers)return cannot_sayhops = hops_of(checkout)return slowest(hops)
def cost_of_search(how, path):if how == 'one recorded request':open(one_screen)return 1work = 0for service in path:work += open(service.window)work += learn(service.own_format)work += ask(service.team)return work
Where this sits in Build a distributed tracing system (Jaeger / Zipkin style)
Scene 01 of 17, in the Why trace act — Per-service records can't blame a hop; one id can.. Logs and dashboards are both recorded per service, so neither can name the hop that consumed the time. One record per hop of a single request, tied together, makes the slow hop name itself.
Up next. One recorded request named the slow hop in a single screen. So what exactly gets recorded at each hop, and how do five records written on five machines become one picture?
All 17 scenes in Build a distributed tracing system (Jaeger / Zipkin style) · Every curriculum