Skip to content
zechim
Back to blog
2 min readobservabilitycostagentsservicesai-consulting

Observability and cost telemetry for AI agents

Per step cost, latency, failures and quality in one view, with a weekly report. What we instrument, which alerts matter, and how we deliver it.

by Zechim

An agent in production is a system with a bill, a latency and a failure rate that nobody sees by default. Teams find out about a problem from a customer or from the invoice.

Observability for agents is the instrumentation that shows what each request did, what it cost and where it failed. It is also what makes cost work, like the one in our LLM cost optimization post, possible. This post describes the service.

This post describes the approach we would use. It cites no client results.

What we do

1. Trace every request

One trace per conversation or task, with each step: the model call, the tools, the queries, the retries. A person can open a trace and see exactly what happened.

2. Record cost and tokens

Tokens and cost per step, per model, per feature and per customer segment. Cached and uncached tokens are separate, so you can see whether caching works.

3. Record latency

Time per step and end to end, with the slow tail and not only the average. A slow tool call is easy to find when each step has its own timing.

4. Record outcomes

Whether the task succeeded, whether a person corrected the answer, whether the user came back with the same question. Where available, the result of your eval set on each release.

5. Alert on what matters

A cost spike per request, a rise in failures, a tool that starts timing out, a loop that runs longer than a limit. Alerts have owners and thresholds that were set from your real numbers.

6. A weekly report

Cost and volume trend, the most expensive features, the most common failures, and the decisions the numbers suggest. Short, written for the person who decides.

What we protect

Traces contain what users typed and what the system answered. We decide with you what is stored, for how long, who can read it, and which fields are masked, and we apply the data protection rules you give us.

What we do not do

  • We do not collect everything forever. Retention is a decision you make with us.
  • We do not alert on noise. An alert nobody acts on trains people to ignore alerts.
  • We do not lock you into a vendor. The data stays in your environment.

How we deliver it

  1. 2 week Discovery. We review your current logs and bills, define the metrics and the alerts, and choose where the data lives.
  2. 4 to 8 week Pilot. Tracing, cost and latency recording, the first alerts and the weekly report, on one agent.
  3. Optional ongoing mode. A Fractional AI Lead reads the report with you and drives the changes it points to.

You keep the code, the dashboards and the documentation.

What you need to start

  • Access to the agent code and to the model provider usage data.
  • A decision on what may be stored from user conversations.
  • Someone who receives the weekly report and can act on it.

If you run an agent and learn about its cost from the invoice, worth 30 minutes to look at what you can see today.