METAL for iPhone

Read AI news in the METAL app.

Download METAL and discover fresh AI stories every day.

Download on the App Store

For iPhone · Free download

Search for METAL AI Magazine in the App Store on your iPhone.

METAL

Claude API Adds OpenTelemetry Tracing Support

Anthropic now supports OpenTelemetry trace export from the Messages API, Claude Managed Agents and the Claude SDKs in public beta. Developers can see model requests, tool use and token counts in their existing observability tools without changing code.

Claude API Adds OpenTelemetry Tracing Support

Image: @ClaudeDevs (X) (video still)

Summary

  • Anthropic launched OpenTelemetry trace export for the Claude API in public beta on October 14 (local time), covering the Messages API, Managed Agents and the Claude SDKs.
  • Spans follow the OpenTelemetry gen_ai conventions and by default carry metadata such as duration, status, token counts, model and tool names; switching to full content mode also exports prompts, responses and tool inputs and outputs.
  • Admins add destinations in the Claude Console, up to 10 per organization, and after delivery the data is held by the observability service outside Anthropic.
Now in public beta, Claude Platform can send OpenTelemetry traces from the Messages API, Claude Managed Agents, and the Claude SDKs

Anthropic released OpenTelemetry trace export for the Claude API in public beta on October 14 (local time). ClaudeDevs, the official X account for Claude developers, said "Claude Platform can send OpenTelemetry traces from the Messages API, Claude Managed Agents, and the Claude SDKs to your observability stack." Each model request and each tool use produces a record called a span, which developers can view in the observability platform they already use without changing their code. The first post reached about 310,000 views three hours after it went up.

What gets exported comes in two levels. "Spans follow the OpenTelemetry gen_ai conventions," Anthropic said, explaining that by default they carry metadata such as duration, status, token counts, model and tool names. Switching a destination to full content mode also exports prompts, responses, tool inputs and tool results. According to the platform documentation, if an organization has a HIPAA, FERPA or K-12 data-handling restriction with Anthropic, prompts and responses may be left out even when full content is set.

Setup happens in the Claude Console. On the organization's OpenTelemetry settings page, users add a destination and enter their observability platform's OTLP endpoint and authentication headers. Adding or changing destinations requires the admin role in the Console organization; the developer role can only view them. The endpoint must be OTLP/HTTP accepting protobuf encoding over HTTPS on port 443, and because a self-run OpenTelemetry Collector listens on port 4318 by default, it must be configured to accept port 443 or be fronted by a load balancer. For each destination, users choose all workspaces, selected workspaces, or all except some. After setup, users can filter for spans whose service.name is claude-platform in their observability platform, and the documentation says it takes about a minute for the Console's delivery status to turn healthy.

API-side traces can be joined to the developer's own application traces. The API reads the trace context of each request from the W3C traceparent header, and if the header's sampled flag is off, it does not emit a span for that request. It also passes traceparent to MCP servers connected through the MCP connector, so the server can place its own spans under the API spans. Claude Platform on AWS does not yet support this header, however, so spans for requests sent there always start their own traces.

On the SDK side, the SDK uses whatever tracer provider the application registers. According to the documentation, the default content mode is metadata only and the default content limit per span is 0.75 MB. Setting a conversation ID groups multiple calls under a single gen_ai.conversation.id. The option to turn off trace context propagation is available in the Python, TypeScript, Go, Java, Ruby and PHP SDKs. SDK tracing is supported in beta on the Claude API, Claude Platform on AWS, Amazon Bedrock, Google Cloud and Microsoft Foundry. When Managed Agents run in a self-hosted sandbox, the SDK rather than the API creates the tool spans, grouping them under one anthropic.environment.work span per work item.

Delivery is best effort. The documentation notes that the same span can arrive more than once, so duplicates should be removed using the trace ID and span ID, and a span lost before delivery is not sent again. The endpoint must complete the TLS handshake within 5 seconds and return response headers within 5 seconds, and each delivery times out after 10 seconds in total. The API disables a destination if it answers with a redirect, resolves to a non-public IP address, or fails every delivery for 24 hours. Each organization can have up to 10 destinations including disabled ones, each destination can cover up to 1,000 selected workspaces, and each destination can carry up to 20 request headers. The documentation states that "after delivery, the data is held by the service that you chose, outside Anthropic, under that service's retention and access controls."

The demo video METAL reviewed uses an incident response agent as its example. When an alert fires, the agent pulls metrics for each service and writes an incident summary, and grouping error-status spans by tool name showed that the Query Metrics tool was timing out on about a third of its calls, causing the agent to burn extra turns on retries. The developer in the video found the cause in about 30 seconds without opening a session log, then grouped the input, output and cache token counts of model request spans by agent to see what the retries cost. METAL previously reported that Claude Managed Agents introduced dynamic workflows, and this feature offers a window into those longer agent runs from the outside.

클로드 API OpenTelemetry 내보내기 한도 표. 조직당 전송 대상 10개, 대상당 워크스페이스 1000개, 요청 헤더 20개, 헤더 값 4096바이트, 엔드포인트 주소 2048자

The point of this announcement is the standard. Rather than building a dashboard of its own, Anthropic chose to export data in the industry's OpenTelemetry gen_ai format, letting developers put Claude agents' requests, tool calls and costs on one screen alongside traces from other models and other applications.

Comments