View all connectors

Claude Code (OTel)

By integrating Claude Code with DX via OpenTelemetry (OTel), you can import per-user daily usage metrics including session counts, lines of code added and removed, commits and pull requests attributed to Claude Code, tool acceptance rates, and per-model token consumption and costs.

This connector works with any Claude Code deployment — including Claude.ai for Teams/Enterprise, Amazon Bedrock, and Google Vertex AI. Unlike the API-based Claude Code connectors, this integration is push-based: Claude Code exports telemetry directly to DX rather than DX polling an external API.

When to use this connector: Set up Claude Code (OTel) for any users who access Claude through a 3rd-party API provider — AWS Bedrock, Google Vertex AI, or similar. These deployments route requests outside of Anthropic’s own API, so no Anthropic-side analytics API can capture their usage; OTel push telemetry is the only way to get that data into DX.

  • All users on Bedrock or Vertex AI: Use this connector only.
  • All users on Claude for Enterprise (no 3rd-party keys): Use the Claude Code (Enterprise) connector only.
  • All users on pay-as-you-go Anthropic Console (no 3rd-party keys): Use the Claude Code (Anthropic Console) connector only.
  • Mixed org — some users on Enterprise or Console, some on Bedrock/Vertex: Set up both this connector and the matching API-based connector (Claude Code (Enterprise) or Claude Code (Anthropic Console)). The API-based connector covers users who access Claude directly; OTel covers users going through 3rd-party providers. When a user has activity from both, OTel data takes precedence in DX reports.

See Which Claude Code connector should I use? for full guidance.

To understand how DX identifies, merges, and links Claude Code users across connectors, see How does DX link Claude Code users?.

Please refer to our schema explorer to see what data DX imports.

How it works

Claude Code supports the OpenTelemetry Protocol (OTLP) for exporting usage telemetry. When configured, it sends two types of signals to DX:

  • Metrics — aggregated counters for sessions, lines of code, commits, pull requests, token usage, cost, and tool decisions.
  • Logs — event-level records used for skill usage tracking.

DX accepts these signals at two OTLP HTTP endpoints and processes them asynchronously into the same daily-usage data model used by other Claude Code connectors.

Setup instructions

Follow the steps below to connect Claude Code to DX via OTel.

Step 1

Navigate to the connections page in DX and select + Connection in the top right.

Select Claude Code (OTel) as the connector type and save the connection. DX will automatically generate a secure ingest token for this connection.

Step 2

Copy the configuration JSON displayed on the connection settings page.

Note: If your security policy does not allow the DX ingest token on developer workstations, route telemetry through a customer-managed collector or gateway.

Step 3

Deliver the configuration to your users using one of the methods below. OTel configuration requires a full Claude Code restart to take effect.

Option A: Claude Code Managed Settings (Claude.ai for Teams/Enterprise)

If your organization uses Claude.ai for Teams or Enterprise, managed server settings are the fastest path — configuration is pushed centrally and applied automatically.

  1. Navigate to Claude.ai Admin SettingsClaude CodeManaged settings.
  2. Paste the JSON copied in Step 2 into the managed settings editor.
  3. Save — Claude Code clients will receive the updated configuration on next startup.
Option B: Local settings file (Bedrock, Vertex, or any deployment)

For Claude Code instances running against Amazon Bedrock, Google Vertex AI, or any other provider, add the OTel configuration to each user’s Claude Code settings file. Also set OTEL_RESOURCE_ATTRIBUTES to user.email= and optionally user.name=, so DX can attribute usage and display names consistently.
Example:

OTEL_RESOURCE_ATTRIBUTES: "user.email=abc@xyz.com,user.name=First%20Last"

Note: White space is not allowed in OTEL_RESOURCE_ATTRIBUTES, replacing it with %20 is required.

The settings file location depends on the operating system:

Platform Path
macOS / Linux ~/.claude/settings.json
Windows %USERPROFILE%\.claude\settings.json

Merge the JSON copied in Step 2 into the existing settings file. If the file does not exist, create it with the copied JSON as its contents.

Note: For organization-wide rollout, distribute the settings file via your MDM platform or configuration management tool.

Skill usage tracking

DX can track which Claude Code skills your developers use, and how often, by capturing skill data through the OTel logs signal. This requires setting an additional environment variable.
Add the following to each user’s environment, or include it in your managed settings:

OTEL_LOG_TOOL_DETAILS: "1"

Ingest endpoints

DX exposes the following OTLP HTTP endpoints for receiving Claude Code telemetry. Signal-specific paths are appended automatically by the OTel exporter.

Endpoint Signal
POST /api/otel/v1/metrics Metrics (sessions, LOC, commits, PRs, tokens, cost, tool decisions)
POST /api/otel/v1/logs Logs (skill usage events)

Requests are authenticated with a Bearer token in the Authorization header. This ingest token is separate from your DX API token and is shown on the connection settings page.

Troubleshooting

No data appearing in DX after setup

  • Confirm the configuration JSON was saved — either in managed settings (Option A) or in the local settings file (Option B) — and that affected users have restarted Claude Code (OTel configuration requires a full restart).
  • For Bedrock or Vertex deployments, verify that outbound HTTPS traffic to the DX ingest endpoint is allowed by your network configuration.