An AI agent can return a perfectly reasonable answer and still be wrong. The lead score never updated. The refund status was stale. The only evidence is a confident final response, and nobody can see which record the agent read or which tool it called.

That gap is what observability closes. Here is a practical way to set it up without drowning in data.

Monitoring vs observability

Monitoring watches predefined measures such as latency, error rate, and uptime. It tells you something is wrong.

Observability lets you open an individual run and see why. For example, a failure rate doubles on Tuesday. Monitoring flags it. Observability shows that most failed runs broke at the same tool call because an auth token expired.

You need both.

What to record: the trace

A trace is the record of one run, start to finish. Each step inside it is a span. A useful trace captures:

  • the original request
  • model calls and the context retrieved
  • the tool chosen, with its inputs and outputs
  • timing for every step
  • errors, retries, and escalations
  • the final response

An illustrative example (simplified):

{ "trace_id": "run_8f21", "task": "qualify_lead", "spans": [ { "step": "read_record", "tool": "crm.get_lead", "status": "ok", "ms": 220 }, { "step": "score", "tool": "model.call", "status": "ok", "ms": 1840 }, { "step": "update_record", "tool": "crm.update_lead", "status": "timeout", "ms": 10000 }, { "step": "retry", "tool": "crm.update_lead", "status": "ok", "ms": 310 } ], "outcome": "completed_with_retry" } 

If your team already runs distributed systems, OpenTelemetry can provide a standard way to collect and export this data.

Metrics worth tracking

Outcome

  • Task completion rate, defined against the real business requirement, not just "returned a response"
  • Accuracy, checked against source records or a human-reviewed sample
  • Escalation rate to a person

Execution

  • End-to-end and per-step latency (a slow agent is often a slow external API, not a slow model)
  • Tool-call success rate
  • Error and retry rates. A high retry rate usually points to a weak integration or unclear instructions

Cost

  • Tokens and model calls per run
  • Average cost per completed task

Build an evaluation set

Observability shows what happened. Evaluation tells you whether it was acceptable. Write test cases for common requests, unusual ones, and situations where the agent should refuse or escalate. Score for:

  • correct tool choice
  • relevant retrieved information
  • adherence to business rules

Combine automated checks with human review for high-impact decisions.

Alert only on what matters

Too many alerts and people stop reading them. Reserve them for:

  • a sudden rise in failed runs
  • repeated timeouts
  • unusual spend
  • falling completion rates
  • unexpected tool activity

Set thresholds from how the agent normally behaves, not from a generic default.

Common mistakes

  • Tracking only response time. A fast answer can still be wrong.
  • Ignoring tool-level failures. The agent looks healthy while the API behind it is failing.
  • Logging everything with no plan, then finding nothing useful.
  • Trusting automated scoring alone for complex decisions.
  • Storing sensitive data in traces. Mask or minimize it, limit access, and set retention rules.

Keep testing after launch

Real users phrase things differently, data changes, and connected services go down. Combine functional, integration, edge-case, security, and regression tests, then review real production runs regularly.

The goal is not to pass a test once. It is a repeatable process that keeps quality steady as prompts, models, and tools change.

The full step-by-step guide, including a six-step setup and FAQ, is here: AI Agent Observability: How to Monitor and Measure AI Agents in Production