A hands-on guide to tracing AI agents with OpenTelemetry, span design, and SDK-level instrumentation for production systems.
Agent TracingLong read

Why General-Purpose Observability Falls Short for LangGraph, OpenAI Agents SDK, and Vercel AI

Agent failures hide between successful calls, so monitor task outcomes.

· 8 min read
Cover illustration for “Why General-Purpose Observability Falls Short for LangGraph, OpenAI Agents SDK, and Vercel AI”
Agent Tracing · November 27, 2026 · 8 min read · 1,881 words

Production monitoring for LangGraph and OpenAI Agents SDK deployments requires session-level tracing, operational metrics, and continuous evaluation against the agent’s instructions. The same requirement applies to Vercel AI SDK, where a successful return can conceal an unfinished task. General-purpose APM remains useful for service health, but it cannot establish task success from individual calls because agent failures propagate through state changes, handoffs, and interrupted workflows.

Why agents fail differently from every other software system you monitor

When an API fails, it often returns an exception or an unsuccessful response. An agent can fail even when every request succeeds. Agents plan, select tools, spawn sub-agents, execute actions, and revise their plans mid-run, so an incorrect decision can become the premise for later decisions. Monitoring therefore has to distinguish successful execution from sound behavior.

The Partnership on AI report The Observability Gap in AI Agents finds that close to half of documented agent failures involve no adversary. These failures stem from unreliable task execution or goals that deployers did not intend, changing what production monitoring must look for. Pre-deployment testing cannot cover all the inputs an agent will face, so teams need to keep monitoring it as it runs to catch failures that tests cannot foresee.

What general-purpose APM actually sees, and what it structurally cannot

General-purpose APM provides useful evidence about service health. An HTTP request span, latency figure, and status code help show whether a model endpoint responded and how long it took. Those are valid operational signals. They do not establish whether the response advanced the agent’s task, whether the selected tool was appropriate, or whether a later decision relied on a damaged result.

Agent observability operates at a different layer. It follows planning loops, tool executions, retrievals, and sub-agent invocations as one causal tree, much as distributed tracing connects events that single-service logging leaves separate. The report defines six enterprise safety monitoring goals and four telemetry processing techniques, then documents systematic gaps across LangGraph, OpenAI Agents SDK, Claude Agent SDK, and CrewAI. The distinction is between recording calls and preserving the evidence needed to assess decisions.

None of the four assessed frameworks emits OpenTelemetry traces with full causal links over OTLP by default. OpenAI Agents SDK does produce causally linked spans by default, but sends them to OpenAI’s proprietary Traces dashboard. Even linked spans need the relevant evidence to explain why a planner on iteration four chose the wrong tool after a result on iteration three was parsed as null.

LangGraph's typed state graph creates failure surfaces that live between nodes, not inside them

LangGraph makes state an explicit part of its control model. Nodes change typed shared state, edges route between nodes, and checkpoints save progress. That structure gives a workflow a clear execution model, but it also creates a failure surface between successful operations. A bad state update can propagate without any individual node reporting an error.

Consider the state-diff example at node N. A tool result is parsed as null, so the planner at node N+1 silently selects a fallback tool. The downstream state then reflects the fallback’s output. Call-level monitoring shows three successful spans with no error, while a node-level state diff reveals the change that diverted the workflow. The transition provides the diagnostic evidence.

Approval telemetry presents a separate reconstruction problem. The report finds that LangGraph supports human-in-the-loop approval for tool use but captures neither the tool-use ID nor the accept or reject decision in telemetry. A functioning approval mechanism and an auditable approval record are different capabilities, even when they concern the same action.

LangSmith provides the deepest observability experience for this framework. It is a paid product beyond a modest free tier, so framework adoption does not imply that the monitoring budget is already covered. That cost is a planning constraint. The more consequential requirement is preserving enough state and decision evidence to explain how one node’s output changed the next node’s behavior.

Diagram: How a Silent State Failure Propagates Through LangGraph Nodes. Visualizes: Show a three-node LangGraph execution where a failure is invisible at the call level but visible at the state level.

OpenAI Agents SDK handoffs fail silently because the trace records behavior, not durable state

OpenAI Agents SDK centers its control model on which agent is in charge. Its handoff primitive records agent behavior, including what an agent did and when it transferred control. That is useful orchestration evidence. It is not a durable, replayable state snapshot at every step, so a behavioral trace alone cannot establish that the right agent received the right context.

This distinction does not negate the SDK’s causally linked spans. A recorded handoff can still lack the evidence needed to diagnose a misfire, such as control reaching the wrong agent or context being lost during transfer. The report finds that both the SDK and LangGraph emit nothing tied to memory operations. Reconstructing a memory-influenced decision therefore requires teams to instrument memory changes themselves.

Identity adds a further limit to reconstruction. Agent names are free-text labels without a uniqueness guarantee, can be duplicated across instances, and have no relationship to an IAM identity. A name in a trace cannot confirm which agent instance handled a turn. OpenAI also does not expose raw reasoning tokens, and the SDK cannot override that platform constraint to reveal the internal reasoning behind a handoff.

Export integration requires additional work as well. For stacks using Datadog, Honeycomb, or a self-hosted setup, the SDK’s tracing requires manually implemented callbacks to send traces to those destinations. That work addresses where telemetry goes. Sending the behavioral record to a monitoring stack already in use does not fill in missing memory changes, durable state snapshots, or instance identity.

Vercel AI SDK streaming and step-limit failures are silent by design, not by accident

When the step limit is reached, generate() returns a finishReason of 'tool-calls' with response.object set to undefined without throwing an error. The maxSteps default is 1. A completion check that relies on the object’s emptiness without interpreting the finish reason can miss the distinction between an unfinished chain and a successful completion. The failure signal is in the return contract.

That contract is especially consequential for monitoring built around exceptions. A workflow can stop before the agent finishes its task even when status-code and exception-rate views show no problems. Vercel AI SDK’s streaming-first, TypeScript-native model therefore needs completion semantics to be interpreted explicitly. Treating a returned call as a completed task discards the evidence the framework supplies.

In a looping workflow, interrupted execution also creates a retry hazard. An undurable, plain AI SDK loop can restart from the top after a crash and run a tool again, producing a second email, payment, or record. Retry cascades can consume substantial tokens while repeating externally visible actions. Even when each execution looks clean, that view does not show whether they are all part of one unfinished attempt.

Vercel’s durable WorkflowAgent pattern using 'use step' checkpoints completed steps and replays their results without re-executing them. Interrupted steps remain a separate concern. An incomplete step can still repeat an external action without an idempotency key. The report did not assess Vercel AI SDK, so its findings are not direct evidence about this framework, but the completion and retry mechanisms expose an analogous need for session-level reconstruction.

Why these three failure surfaces share the same root cause — inspection at the call level misses causality at the session level

In each framework, monitoring must establish how one step constrained or redirected another, beyond whether either step executed successfully. The report distinguishes telemetry that records what happened from signals that establish whether an agent’s decisions were sound. Enterprises need both, and call-level service monitoring supplies only the former.

Retrospective accountability makes that distinction more demanding. The report notes that regulated enterprises may need to explain months later why an agent declined a loan or closed an investigation, including whether its grounds were permissible. That takes a full session record that teams can trust, with the call logs linked together. The next requirement is therefore not simply to collect more events, but to preserve the relationships and evidence needed to judge the workflow.

What does production monitoring for LangGraph and OpenAI Agents SDK deployments require?

Operational metrics help catch service problems, while session traces link the decisions that shape how a task turns out. For LangGraph, that means evidence of node-level state transitions. For OpenAI Agents SDK, it means handoff context, distinguishable agent instances, and instrumented memory changes where decisions depend on memory.

Vercel AI SDK adds a requirement to interpret completion and retry semantics. A monitoring layer must distinguish a completed task from a step-limit truncation rather than infer completion from the absence of an exception. It also needs enough causal context to relate repeated executions to the interrupted workflow. These requirements follow from the failure mechanisms.

Evaluation then has to assess behavior against instructions. Evaluation should identify citing the wrong policy, inventing identifiers, or choosing the wrong tool as issues even when every HTTP request succeeds. Outcome graders check results at scale, while step-level diagnostics give teams the evidence they need to find and fix the failure. Neither layer can make up for missing telemetry by giving a confident verdict.

LLM-as-judge alone is insufficient for this work at scale. It can be too slow and expensive to run on every turn, exhibits position bias and probabilistic inconsistency, and cannot judge evidence outside the material it receives. Unlogged environment state remains unavailable to the evaluator. An instruction-based audit is only as conclusive as the relevant evidence in its input.

Manually reviewing every trace is not tractable, so recurring failures need to be grouped into prioritized issues across sessions. Static offline evals remain useful for fixed datasets, but cannot establish whether production quality has degraded since deployment. Continuous online evaluation checks for that drop in quality, while sending issues to Slack, Linear, or a coding agent via MCP brings the diagnosis into the work teams already do.

Fixes should automatically become new evals so the same failure pattern cannot recur undetected. A failure discovered in live traffic becomes a test of future behavior rather than an explanation that is filed away after the immediate issue is resolved.

How Lemma closes the loop from silent failure to regression-blocking eval

Lemma is one production monitoring option that records agent behavior, audits every trace against the agent’s own instructions, and groups recurring failures into prioritized issues. It routes those issues to Slack, Linear, or a coding agent through its MCP server, then creates an online eval after a fix ships so a recurrence can be detected.

A trace can complete without exception and still show the wrong policy citation, a poor tool choice, or a result that does not match the assigned task. Grouping those findings across sessions shows which behaviors recur, so engineers do not have to query each trace on its own.

That approach does not remove the need for instrumentation. An audit cannot reconstruct an unlogged memory change, recover unavailable reasoning tokens, or infer a missing approval decision with certainty. How well teams can explain a failure still depends on state diffs, handoff evidence, and completion signals. The monitoring layer evaluates that evidence.

The resulting fix then becomes an online eval to check whether the failure recurs. The eval acts as a regression check on the known failure pattern, rather than a guarantee that every future task will succeed. Teams gain a way to find silent failures before users do.

Sources

  1. The Observability Gap in AI Agents: What to Fix Before Agents Scale - Partnership on AI
  2. When Errors Become Narratives: A Longitudinal Taxonomy of Silent Failures in a Production LLM Agent Runtime
Filed underAgent Tracing

More in Agent Tracing