How do we monitor AI Agents in production?
Tests prove it worked yesterday. Monitoring tells you about today.
Picture it first
A school bus has a GPS tracker and a camera. Parents can see where it is, how fast it's going, and if it stopped somewhere strange. If something goes wrong, the school can replay the video to see exactly what happened. Monitoring gives AI apps the same tracker and replay camera.
Now the same idea, in simple QA words
After release, we need to watch the AI every day. Monitoring records every request like a flight recorder: what the user asked, what documents were found, which tools were called, what the AI answered, how long it took and how much it cost. From this we build dashboards and alerts — slow answers, high cost, errors, thumbs-down from users, low quality scores. When something goes wrong, we can replay exactly what happened.
How the story connects to the real thing
Real-world example
A travel-booking agent's weekly dashboard shows p95 latency jumped from 6s to 19s. Traces reveal the agent is calling search_hotels 7 times per request after a prompt change — a retry loop on an empty result. The team fixes the prompt, adds a max-calls guard, and adds the failing trace as a new regression test.
Step by step, in plain words
- Record every step of every request (a 'trace').
- Add details: model, prompt version, time, cost.
- Show the numbers on a dashboard.
- Score a sample of real answers for quality.
- Set alerts for bad numbers.
- Turn every bad case into a new test.
How a tester tests it
- Verify instrumentation itself: does every step appear in the trace with correct IDs?
- Check PII is masked in logs and traces.
- Define alert thresholds and test that alerts actually fire (inject a slow tool).
- Close the loop: production failures → new regression test cases.
Try it yourself
1) Draw a trace for one agent request with 4 spans (LLM, retrieval, tool, LLM). 2) Write 3 alerts you'd configure and their thresholds.
Interview angle
“Your agent passed all pre-release evals but users complain. What's your monitoring approach?”
I'd look at production traces filtered by negative feedback, cluster them by intent and failure type, and compare live input distribution with the golden set — users often ask things the eval set never covered. Then I add those cases to the eval set and set up online evaluation on sampled traffic so drift is visible early.