Summary: Anthropic has shipped OpenTelemetry export for the Claude API and SDK, currently in beta, so your Messages API requests, tool uses, and Managed Agents sessions show up as standard spans. You can read them in whatever observability platform you already run. For anyone building agents, this turns debugging from guesswork into a trace you can click through.
Why this matters if you ship agents
Agent failures are rarely one bad API call. A single user question can trigger a tool runner loop: a model request, a web search, a custom tool call, a second request with the results. When latency spikes or a run fails, the hard part is knowing which step broke.
Per the Anthropic documentation, the API and SDK now emit OpenTelemetry spans covering exactly that. A trace records one request through your system; each span is one step, like a model request or a tool use. Because the spans follow the GenAI semantic conventions, observability platforms that support those conventions recognize them without extra setup. That’s the practical win: no bespoke Claude dashboard, no new vendor.
I’ve written before about how hard cost and latency attribution gets once one user request fans out across multiple model and tool calls (cheap workers, a strong lead). Standard spans are the plumbing that makes that kind of accounting possible without custom logging.
SDK tracing, API tracing, or both
There are two setup paths, and they cover different things:
- SDK tracing requires no special permissions and covers clients using the SDK, including client-side tool runs, self-hosted sandbox tools, and other API calls like file uploads. Setup is code: install the SDK and register a tracer provider.
- API tracing requires an Admin permission and is configured by adding a destination in the Claude Console. It covers any client and adds what only the server can see: each individual model run within a request, Managed Agents turns, and server-side tools.
The docs recommend setting up both so a request’s SDK and API spans land in one trace. One caveat: for Claude Platform on AWS, the API spans land in their own traces rather than merging with the SDK’s.
Choose your content mode carefully
This is the decision with real compliance weight. Each destination and SDK client has a content mode:
- Metadata only (the default): identifiers, timing, status, token counts, and text you choose, like tool and agent names.
- Full content: adds the actual model prompts and responses, which makes it possible to see why a run failed and build evals from real traffic.
Two guardrails worth noting. If your organization has HIPAA, FERPA, or K-12 data-handling restrictions with Anthropic, destinations export metadata only regardless of the mode (SDK spans are unaffected). And zero data retention customers can still use Full content — for Messages API requests, content is held in memory only until delivery — though Managed Agents isn’t eligible for zero retention at all.
Content is also size-capped. Full content spans hold up to 0.75 MB by default, sized to fit a 200k-token English context window and stay under the 1 MB limits many platforms impose. If you exceed it, the system truncates — dropping the system prompt and earliest messages first — and sets anthropic.content.truncated to true. A full 1M-token window needs roughly 4 MB, so raise the limit if your platform accepts it, or lower it if a proxy in the path rejects big payloads. In the SDK the setting is traces.max_content_bytes; in the Console it’s a maximum content size under the destination’s advanced settings.
Also check your observability platform’s own access and retention rules — once prompts land there, they’re governed by those settings, not Anthropic’s.
A grounded next step
If you’re already sending app traces through OTLP, wiring this up is a small change: register a tracer provider in the SDK, add a Console destination if you want server-side spans, and start with Metadata only before deciding whether Full content is worth the exposure. The example traces in the docs are the fastest way to see how a tool runner loop reads as nested spans. One limitation to keep in mind: the beta status means details may shift, so pin your expectations accordingly.
Sources
View the original post on X
