Agent Observability Best Practices
Ten practices for tracing, alerting, and reviewing agent behavior in production. Use them as a launch rubric and a weekly ops checklist for agent systems.
Search across all documentation pages
Ten practices for tracing, alerting, and reviewing agent behavior in production. Use them as a launch rubric and a weekly ops checklist for agent systems.
run_id per user task, propagated everywhere. Workers, tools, queues, and logs must reuse the same id so reconstruction is a filter, not archaeology.stop_reason. Include goal_met, max_turns, timeout, budget_exceeded, error, escalated, killed (extend as needed).run_id. Quality scores without path context do not produce fixes.agent_version / git sha on every run. Canaries and rollbacks need version filters in both agent UI and APM.run_id and explain side effects from traces alone.run_id → agent UI → classify logic vs infra → mitigate.The section promise is ten core production practices (items 1-10). Items 11-15 extend them into engineering process and drills so the list stays usable after launch.
Stable run_id propagation plus tool/model nesting. Everything else depends on being able to fetch one task's path.
Demos can be lighter, but anything with real tools, credentials, or spend should implement redaction, stop reasons, and basic success/latency metrics before wide access.
None specifically. LangSmith, Langfuse, Phoenix, or a disciplined custom logger can all satisfy the practices if the data model is right.
Agents need trajectory fields (tools, turns, stop reasons, eval joins) that request logs alone do not provide - but they still need classic APM underneath.
Into the same on-call path as other production services. Agent-specific Slack channels without ownership become wallpaper.
At least weekly for active agents, plus every release that changes prompts, tools, or models, plus every SEV.
Metrics: rates, latencies, cost aggregates for alerting. Traces: full path for diagnosis. Evals: quality scores joined by id.
Add specialist labels and handoff packet ids; keep a parent run_id for the user task so ownership stays clear.
Only if the agent has no meaningful dependencies. As soon as tools hit networks, queues, or DBs, pairing prevents false "model is slow" root causes.
API keys, session cookies, or raw credentials appearing in exported traces or support screenshots.
In the section sidebar as the close-out checklist, and from deploy runbooks for agent services.
Stack versions: Pins from the category manifest (verify at build): OpenRouter (~315+ models, July 2026 pricing/fees); LangGraph 1.0+; CrewAI 1.14+; Microsoft Agent Framework 1.0; Vercel AI SDK 6; Pydantic AI (latest); LlamaIndex (latest); OpenAI Agents SDK (latest + MCP); MCP (Linux Foundation governance); A2A (HTTP+SSE+JSON-RPC 2.0); Solana
@solana/web3.js+@solana/spl-token.
Reviewed by Chris St. John·Last updated Jul 16, 2026