Lion Cipher Lab

Trace a whole agent-team run and find the real bottleneck: build an OpenTelemetry-shaped tracer from scratch, compute self time, slack and the critical path, and prove the slowest span is not the problem

Why it matters

An agent team is a distributed system that its authors usually refuse to think of as one. The moment you have a planner, four workers and a critic, latency stops being a property of any single model call and becomes a property of the STRUCTURE - who was handed work first, who queued for a tool somebody else was holding, who retried three times, and who everybody had to wait for at the end. Part 1 of this pair taught you to trace one call and read p50, p95, tokens and cost from a pile of them. That is exactly the right instrument for one call and exactly the wrong instrument for six actors,…

What you'll learn

Steps in this lab

  1. Part 1 traced one call. This lab traces a whole team.
  2. Open a terminal, check Python, make a folder
  3. Build the tracer, part 1: what a span actually is
  4. Build the tracer, part 2: the Tracer - and what it deliberately leaves out
  5. The incident, the team, and why the clock is deliberately fake
  6. Emit the trace: the run that produces 37 spans
  7. Read one span with your own eyes before you read 37
  8. Read the trace, part 1: rebuild the tree, compute self time, draw a waterfall
  9. Read the trace, part 2: the critical path, slack, and the per-worker table
  10. Run the analysis, and watch the slowest span turn out to be innocent
  11. Fix one thing, re-measure, and watch the bottleneck move
  12. Now do the obvious thing instead, and measure how little it buys
  13. Sampling and cardinality: the two things that decide whether you can afford this
  14. When NOT to build your own tracer
  15. What to take back to your own agent team

Open the full interactive lab →