LLM Observability: Monitoring AI Agents in Production
AI agents fail silently — wrong answers return HTTP 200. The metrics, traces, and weekly review loop we use to monitor LLM systems running 500+ actions a week.
Ostap Kovalisko
Founder & AI Systems Architect
Traditional monitoring assumes failures look like failures: errors, timeouts, 500s. LLM systems break that assumption. A misrouted request, a hallucinated client name, a confidently wrong draft — all of them return 200 OK in 800ms. Your uptime dashboard glows green while the agent quietly erodes user trust.
Observability for AI agents means making quality failures as visible as availability failures. Here's the stack we run on production systems handling 500+ actions per week across 30 action types.
Trace Everything, End to End
The unit of observability is not the API call — it's the full journey from trigger to outcome. Every request gets a correlation ID at entry, and every stage appends a span:
- Trigger received (message, email, webhook) — source and timestamp
- Intent classification — matched action, confidence, tier, latency (our budget: under 200ms)
- Graph traversal — every node visited, every edge taken, every clarification asked
- Context retrieval — which of the 9 connected sources were queried, hit counts from the 38,000+ embedding index
- Model calls — model, prompt version, tokens, latency, cost
- Tool execution or proposal — payload, validation results, approval-queue decision
- Outcome — approved, rejected, edited, reverted, or user correction downstream
When a user says "the agent did something weird Tuesday," the answer is one trace lookup, not an archaeology dig across five log systems. This is the same discipline as distributed tracing in microservices — the spans are just weirder.
The Metrics That Matter
| Metric | What it detects | Our alert condition |
|---|---|---|
| Routing accuracy (weekly, labeled) | Classifier degradation | Drops below 95% |
| Confidence tier distribution | Calibration drift — sudden shifts mean input drift or a broken change | Tier share moves >10 points week-over-week |
| Approval rate per action type | Quality regression on a specific action | Falls >15% from its baseline |
| Edit distance on approved drafts | Drafts getting worse before rejections spike | Trend alert |
| Clarification loop count | Narrowing trees that trap users | >2 clarifications per request |
| p95 latency per stage | Slow context fetches, model slowdowns | Stage budget exceeded |
| Cost per action | Token bloat, retry storms | >2x action baseline |
Note how many of these come free if you built the system right: the approval queue produces labels, the audit trail produces traces, the confidence scores produce calibration data. Observability isn't a separate project — it's the exhaust of good architecture.
Drift: The Slow Failure
The failures that hurt most aren't incidents; they're drifts. A model provider updates a version and your extraction gets subtly worse. A new client type changes the input distribution. A prompt edit two weeks ago shifted routing on one action. None of these page anyone.
Our defenses:
- A frozen evaluation set: several hundred labeled real requests, re-run against the live pipeline nightly. Score changes localize the drift to a stage.
- Shadow comparisons on every change: model upgrades and prompt rewrites run in shadow against the current version before cutover — the same shadow-mode machinery from initial deployment, kept forever
- Per-action baselines: aggregate metrics hide local failures; one action collapsing from 98% to 80% approval barely moves a 30-action average
If your only alert is on error rate, your AI system has been broken before and you didn't know. The users knew.
The Weekly Review Ritual
Dashboards don't improve systems; the loop does. Every week, 45 minutes, same agenda:
- Every rejected proposal — why, and does it become an anti-pattern example?
- Every misroute flagged by users — new positive example on the correct action
- Top 5 highest-edit-distance approvals — what did the human fix, and can the prompt or context fetch absorb it?
- Calibration check — is the 0.9+ tier still above 97% actual accuracy?
- One metric trend discussed, one concrete change shipped
This ritual is how our routing accuracy got to 95% and stays there. Not a bigger model — a tighter loop.
Starting from Zero
- Add a correlation ID and log every model call with prompt version, tokens, latency, and cost — today, before anything else
- Capture outcomes: approvals, rejections, edits, user corrections. Labels are the scarce resource; harvest them from day one.
- Build the frozen eval set from your first 200 real requests
- Set alerts on distributions, not just errors
- Schedule the weekly review before you think you need it
You can't manage what you can't see, and with LLMs you can't see anything by default. Instrument first; the intelligence is only as good as your ability to notice when it stops being intelligent.
Let's Talk About Your Project
Have questions about nearshoring or AI development? Our team is here to help you make the right decision.
- ✓Free consultation on your AI project
- ✓Custom cost estimates and timeline
- ✓Access to nearshore talent pools