[FEATURE] Allow overriding OTEL resource attributes (e.g., user.email) for Bedrock users

Resolved 💬 3 comments Opened Apr 3, 2026 by nahi Closed Apr 3, 2026

Summary

When using Claude Code with AWS Bedrock (CLAUDE_CODE_USE_BEDROCK=1), the user.email OTEL resource attribute is always empty because there is no Anthropic account. Allow users to override this via environment variable or config.

Motivation

Organizations using Bedrock want to track Claude Code usage per user in their observability stack (Datadog, Grafana, etc.). Currently, user.email is only populated from the Anthropic account, which doesn't exist for Bedrock users.

Additionally, standard OTEL environment variables like OTEL_RESOURCE_ATTRIBUTES are ignored — Claude Code builds its own resource attributes without merging user-provided values.

Proposed Solution

Either:

  1. Respect OTEL_RESOURCE_ATTRIBUTES — Merge user-provided attributes with built-in ones
  2. Add specific env vars — e.g., CLAUDE_CODE_USER_EMAIL to override user.email

Current Behavior

export OTEL_RESOURCE_ATTRIBUTES="user.email=me@example.com,deployment.environment=prod"
export CLAUDE_CODE_ENABLE_TELEMETRY=1
claude
# -> user.email is still N/A in telemetry
# -> deployment.environment is also missing

Expected Behavior

User-provided OTEL resource attributes should be included in telemetry output.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗