AI Agent Observability Monitoring 2026
When an agent fails, classic monitoring reports healthy CPU and 200 responses while saying nothing about what it thought, which tool it called, or where the money went. This compares Langfuse, LangSmith, Arize Phoenix, Datadog and a self-hosted stack, with metrics and alerting that work.
📜 Table of Contents
📖 Keep reading
Agent Observability: Langfuse, Datadog or Self-Hosted?
Classic monitoring sees one HTTP call. An agent request is a dozen nested steps: plan, pick a tool, call it, read the result, replan. Failures usually look like 200 OK with a wrong answer, so observability has to start at the trace level.
What is different
| Dimension | Web service | Agent |
|---|---|---|
| Structure | single request | multi-step nested trace |
| Cost unit | CPU, bandwidth | tokens, tool calls |
| Failure | 5xx, timeout | task not completed |
| Quality | availability SLI | evaluation sets and review |
Six metrics that matter
| Metric | Alert hint | Why |
|---|---|---|
| Task completion rate | 10 points below baseline | primary signal, split by task type |
| Avg steps | above historical P95 | retry loops after tool failures |
| Tokens per task | 2x historical P95 | runaway context or huge tool output |
| Tool failure rate | above 5% sustained | separate timeout, auth, bad args |
| P95 latency | per business tolerance | split model time from tool time |
| Cost per task | per budget | split by task, model, tenant |
Treat thresholds as starting points. Collect for a week before alerting, or you will page on noise.
Options
- Langfuse: open core, self-hostable, detailed traces, prompt versioning, evaluations. Best default for self-built agents.
- LangSmith: tightest fit with LangChain and LangGraph; weaker fit outside that ecosystem.
- Arize Phoenix: open source, easy local runs, strong offline evaluation, thinner production dashboards.
- Datadog LLM Observability: best when Datadog already covers your stack; usage-based pricing.
- Self-hosted OTel stack: full control, highest maintenance. For platform teams with compliance constraints.
| Option | Deploy | Trace detail | Evaluation | Fit |
|---|---|---|---|---|
| Langfuse | self-host or cloud | high | yes | most teams |
| LangSmith | cloud | high | strong | LangChain users |
| Phoenix | self-host | medium | strong offline | experiments |
| Datadog | cloud | medium | basic | existing Datadog shops |
| OTel stack | self-host | custom | build it | platform teams |
Minimal instrumentation
from opentelemetry import trace
tracer = trace.get_tracer("agent")
with tracer.start_as_current_span("agent.run") as span:
span.set_attribute("gen_ai.system", "openai")
span.set_attribute("agent.task_type", "refund_query")
result = step_plan(query)
span.set_attribute("agent.steps", result.steps)
The GenAI semantic conventions are still evolving; prefix custom attributes to avoid collisions.
Sampling
Keep 100% of failures and slow requests, sample 5-10% of successes. That is tail sampling: buffer first, decide later. Random head sampling throws away exactly the traces you need.
Alerting
Alert on 5-15 minute ratios, not single requests: completion rate, failure rate, P95 latency, cost per task. Add a steps-anomaly alert; it catches tool regressions earlier than anything else. Attach task type, model version and prompt version to every alert.
FAQ
Do small teams need a commercial tool? Start with self-hosted Langfuse; move up when you need cross-team dashboards or audit.
Can traces hold raw user text? Usually yes technically, but redact identifiers and personal data before storage.
Store full prompts every time? Store one copy per version, reference the version id in traces.
Is evaluation the same as monitoring? No. Monitoring catches anomalies in real time; evaluation measures quality on datasets.
Features and free tiers change; check vendor documentation.
Related
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.