Claude Platform traces

Start tracing in 5 minutes

Send OpenTelemetry traces of your Claude API requests and Managed Agents sessions to Better Stack. Each model request, tool use, and agent turn arrives as a span, with token usage, latency, and errors ready for dashboards.

1. Create a Claude Platform source

Create a new Claude Platform source in Better Stack

2. Add a destination in the Claude Console

As an admin of your Claude Console organization:

  1. Open the OpenTelemetry settings page and click Add destination.
  2. Set Provider to Custom.
  3. Set OTLP endpoint URL to the URL below. Don't add /v1/traces. Claude adds it.
  4. Under Request headers, add the header Authorization with the value below.
  5. Keep Content mode at Metadata only. Choose Full content to also send prompts and responses.
  6. Set Workspaces to All.
  7. Click Add destination.
OTLP endpoint URL
https://$INGESTING_HOST


Authorization header value
Bearer $SOURCE_TOKEN


3. Send a test span

  1. Click Test in the destination's More actions menu.
  2. Open Live tail and select your Claude Platform source marked as spans.
  3. Check that the anthropic.test span arrived.

Test failed?

The Console's message names the error. HTTP 401 or 403 means the Authorization header value doesn't match your source token.

4. Start tracing

Messages API requests and Managed Agents sessions in your workspaces now send their spans to Better Stack, under the service claude-platform. See Tracing for how to explore them.

Chart tokens and errors on dashboards

The source extracts these metrics from the spans, so you can chart them in dashboards:

  • Token usage: gen_ai_input_tokens, gen_ai_output_tokens, gen_ai_cache_read_input_tokens, and gen_ai_cache_write_input_tokens. Each token is counted once, following Anthropic's counting rule. Input tokens already include cache reads and writes.
  • Labels: gen_ai_model, gen_ai_operation, gen_ai_tool_name, gen_ai_agent_name, error_type, stop_reason, workspace_id, and outcome_evaluation_result.
  • Span count and latency: duration, as on any traces source.

For every span and attribute Claude sends, see Anthropic's span reference.

Need help?

Please let us know at hello@betterstack.com. We're happy to help! πŸ™