An AI Observability Framework for Your Agentic Applications
AWS proposes a four-layer observability framework for agents that tracks quality, cost, and security by correlating traces across the entire application stack.
Deep dive
- Four Layers: Observability must cover the application, agentic logic, model inference, and hosting infrastructure.
- Failure Modes: Agents don't just crash; they drift, hallucinate, and incur unexpected costs through infinite reasoning loops.
- Shift Left: Instrumentation should be implemented at the first prototype to capture regression data in CI/CD.
- Connected Traces: All layers must use shared trace context to allow developers to see the database query that caused a slow agent response.
- Evaluation Gates: Automate the process of blocking code merges if changes cause agent outputs to drift or fail quality checks.
Decoder
- Agentic AI: Applications that can autonomously decide which tools to call, which data to retrieve, and when to terminate tasks, as opposed to simple request-response models.
- Time to First Token (TTFT): The latency between sending a prompt and receiving the first piece of generated text; critical for perceived application speed.
- OpenTelemetry GenAI Conventions: A set of standardized attribute names and trace formats for AI/ML components, allowing observability tools from different vendors to understand agent-specific telemetry.
Original article
An AI Observability Framework for Your Agentic Applications
Best practices for every layer, from the first prototype to production
Agents have moved beyond proof of concept. IDC’s July 2026 survey found that 95% of enterprises now run at least one agent-enabled workflow in production, and 67% exceeded their agent budgets by more than 10% in the past year. Gartner predicts that more than 40% of agentic AI projects will be canceled by the end of 2027 because of escalating costs, unclear business value, or inadequate risk controls. Each of those causes is a visibility problem.
For years, observability helped humans answer questions about deterministic software, where the same input followed the same logic defined in the code. An agent decides at runtime which tools to call, which context to trust, how many steps to take, and when to stop. Two identical requests can take different paths at very different costs, and an answer can be fluent, fast, and wrong. Knowing that a service is up tells you very little about whether an agent is behaving.
This post presents a framework for observing agents across their whole lifecycle, from the first prototype to production. It breaks an agentic system into four layers: the application the agent is part of, the agent’s reasoning and tool calls, the models behind it, and the infrastructure underneath, with best practices for each one: what goes wrong, the signals that detect it, and where to start.
What changes with AI workloads
Traditional monitoring assumes that the code defines the behavior. Agents break that assumption in four ways:
- Behavior changes without a release. A model update, refreshed knowledge base, or a new tool can change what an agent does without going through your deployment pipeline.
- Wrong answers look like the right ones. Agents rarely fail with errors. They return a confident answer from the wrong document or report a task as done when it is never finished.
- Context becomes instruction, and actions carry permissions. Anything an agent reads (a document, a tool description, another agent output) can steer it, and it acts with real credentials on real systems.
- Cost follows reasoning, not traffic. Steps, retries, and reasoning tokens set for the bill, so the same request volume can cost very different amounts from one day to the next.
This is how agentic systems normally behave, which is why observability has to span every layer.
The framework
An agent never runs in isolation. It is part of an application, calls models, and runs on infrastructure, and a problem rarely stays in the layer where it shows up. The framework has two dimensions. The first is the four layers an agent depends on, from the top down:
- Application: the application code, and the services, APIs and data stores it calls
- Agentic: the agents and the tools, retrieval, memory, and protocols they use
- Model: managed or self-hosted inference
- Infrastructure: the compute that hosts the agents and the models
The second dimension is how a layer can fail. Any layer can stop working or give wrong answers, spend more than it should, or reach data it shouldn’t. So the framework tracks three cross-cutting concerns in every layer:
- Reliability and Quality: does it work and give the right answer
- Cost: what it spends
- Security and Governance: what it can reach, and who approved it
1. The application layer
Many of the problems users notice first, such as slow or failed answers, start in the services around the agent, not in the agent itself.
Scope. The application the agent is part of: the application code and user-facing surface, the gateways and content delivery upstream, and the microservices, databases, queues, and caches downstream that the agent calls. Most teams already monitor this layer well. The gap is that agent telemetry usually lives somewhere else.
Failure patterns:
- Reliability and quality: a slow or failing downstream service makes the agent look slow; a stale cache feeds the agent outdated data.
- Cost: retries against a slow service multiply model calls and tokens.
- Security and governance: the agent writes to systems of record with no audit trail, or calls APIs without per-request authorization.
Detection signals:
- Request rate, errors, and duration for every service the agent calls
- Database query latency, slow queries, and connection-pool saturation
- Queue depth and consumer lag for work the agent hands off
- Cache hit rate and freshness for data the agent reads
- Writes to systems of record, tagged with the agent’s identity
2. The agentic layer
This is where agents fail without errors. The service is healthy, and the behavior is wrong.
Scope. Everything that turns a model into an agent: the agents, the tools they call, the knowledge bases behind retrieval, the protocols that connect them, and the harness that builds the context, runs the loop, calls tools, handles errors, saves state, and enforces approvals.
Failure patterns:
- Reliability and quality: a confident answer from the wrong document, the same search repeated with rephrased inputs, calls to tools that don’t exist, an instruction lost when the harness compacts context, or a task reported done that never finished.
- Cost: steps, retries, and sub-agents that multiply with no limit.
- Security and governance: instructions hidden in a retrieved document or tool output that steer the agent, and actions outside the agent’s intended scope.
Detection signals:
- The trace tree, with one span per reasoning step, tool call, retrieval, and handoff
- Tool calls per task, error rate per tool, and invalid or nonexistent tool calls
- Steps per task against the task’s normal range, repeated actions, and whether each run reaches a terminal state
- Retrieval relevance, and how well the answer is grounded
- Approval gates requested, granted, and denied
3. The Model Layer
Model calls drive most of an agent’s latency and cost, and a single run often calls more than one model.
Scope. A single agent run can call several models: a reasoning model to plan, a decision model that routes or checks a step, embedding and reranking models for retrieval, and models constrained to a fixed output format.
Failure patterns:
- Reliability and quality: confident routing decisions that turn out wrong, retrieval that slowly drifts, and responses that are truncated or break the required format.
- Cost: reasoning tokens the user never sees, and lost prompt-cache hits.
- Security and governance: guardrails that block legitimate requests or miss unsafe ones, sensitive data in prompts and responses, and model versions that change without review.
Detection signals:
- Time to first token (TTFT), tokens per second (TPS), and total response time
- Tokens by type (input, output, reasoning) and cache hits
- Cost per call, attributed to the agent, task, and team
- Quota use, throttling, and provider errors
- Decision-model confidence against observed accuracy
4. The infrastructure layer
Infrastructure problems rarely show up where they start. They surface a layer or two up, as a slow agent or one that loses its place mid-task.
Scope. Hosting the agents (containers, serverless functions, or managed agent runtimes) and hosting the models you serve yourself.
Failure patterns:
- Reliability and quality: a restarted container drops an agent’s session, a slow vector store looks like a slow agent, and memory pressure evicts cached context.
- Cost: idle or over-provisioned GPU capacity.
- Security and governance: over-privileged credentials on agent runtimes.
Detection signals:
- Agent runtime CPU and memory, restarts, cold starts, and session survival
- Vector store latency and index freshness
- GPU utilization, key-value (KV) cache use and evictions (self-hosted)
Work across the layers
Signals at each layer tell you what is happening there. The most valuable insight comes from the connections between layers, achieved through shared trace context and a dependency map. Standardizing on OpenTelemetry ensures that your instrumentation survives framework or model provider changes.
Accountability requires matching oversight to the autonomy granted: an agent that only reads needs traces and quality scores, while an agent that changes systems needs approval gates, audit trails, and circuit breakers.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi