The Claude Platform can export OpenTelemetry (OTel) traces for Messages API requests, tool uses, and Claude Managed Agents sessions.
The spans follow the GenAI semantic conventions, which
AI Observability natively understands.
You can collect traces from two sources, and combine them:
OpenTelemetry export on the Claude Platform is in beta. Span and attribute names may change.
This guide is for:
By following this guide, you'll learn:
AI Observability.To get started, you need to have:
openpipeline:traces:ingest scope.It's helpful to have some basic knowledge of:
In the Claude Console, go to Settings > OpenTelemetry and select Add destination.
For Provider, select Custom.
For OTLP endpoint URL, enter https://<your-environment-id>.live.dynatrace.com/api/v2/otlp.
Don't append /v1/traces; the Claude API adds it.
Under Request headers, add the Authorization header with the value Bearer <your-platform-token>.
Choose a Content mode:
AI Observability.Select the Workspaces to export, then save the destination.

With Full content, the default Maximum content size in MB of 0.75 MB per span works with Dynatrace. Dynatrace accepts OTLP trace requests of up to 8 MB. For details, see OTLP trace ingest limits. If you raise the limit under Advanced settings, keep it well below 8 MB, because a single request can contain several spans.
In the destination's More actions menu, select Test.
The Claude API sends a single anthropic.test span to Dynatrace and reports whether delivery succeeded.
After real traffic flows, the Delivery column shows Healthy.

The Claude SDK emits spans through the tracer provider registered in your application. Configure an OTLP exporter that points to Dynatrace, then pass the provider to the client. The following example uses Python; the SDKs for TypeScript, Java, Go, C#, PHP, and Ruby support the same options.
pip install anthropic opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://<your-environment-id>.live.dynatrace.com/api/v2/otlp/v1/traces"export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer <your-platform-token>"export OTEL_SERVICE_NAME="my-claude-app"
from anthropic import Anthropicfrom opentelemetry import tracefrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporterfrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.sdk.trace.export import BatchSpanProcessorprovider = TracerProvider()provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))trace.set_tracer_provider(provider)client = Anthropic(open_telemetry={"tracer_provider": provider,"traces": {"content_mode": "content"}, # omit for metadata only})message = client.messages.create(model="claude-sonnet-5-5",max_tokens=256,messages=[{"role": "user", "content": "Write a haiku about observability."}],)print(message.content[0].text)provider.shutdown()
Use API tracing and SDK tracing together, both sending to Dynatrace.
The SDK propagates the W3C traceparent header, so the API's server spans join your application's trace.
AI Observability.anthropic or by your model to find Claude requests.anthropic.messages.create, anthropic.model_request, and tool spans and their gen_ai.* attributes.The Agents topology view shows how your applications, the claude-platform service, the anthropic model provider, and the Claude models connect.

API spans arrive with service.name set to claude-platform.
You can also query them in Distributed Tracing or with DQL:
fetch spans| filter service.name == "claude-platform"| fields start_time, span.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, duration

When a request has both an SDK span (CLIENT) and an API span (SERVER), both carry token usage.
To count tokens once, sum only the API spans. For details, see Counting tokens.