Trace-Based Debugging
In this article
- Compare a good and a bad trace of the same request step by step and name the first step where they differ.
- Tell the root cause from later steps that behaved correctly on wrong input.
- Rule out a model or prompt change from the recorded fields before blaming a tool.
- Reproduce live with pinned versions, say why a replay of recorded tool results cannot, and confirm a fix the same way.
- Terms defined here: trace-based debugging, first divergence.
Overview
A customer asks for a $25.00 refund, and the assistant tells them a colleague will review it. The ticket lands with you. The last step of the run is the loud one: a refusal, then a hand-off to a person. It is also the wrong place to start.
Brightline's support assistant looks up orders and issues refunds; code refuses any refund above $50. You will put a bad run next to a good run of the same request, find the first step where they part, and see why every step after it is a symptom. Then you will rule out a version change, reproduce the failure live, and confirm a fix the same way.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Start from the loudest span
- Two runs side by side
- Find the first row that differs
- Rule out a version change
- Reproduce it live
- Fix at the boundary, confirm the same way
- When the wrong value stays hidden
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions