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.

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 for tool decisions and API requests, including per-model token and cost details.

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.

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.

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 (tool decision events, API request 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.