[FEATURE] Support OpenTelemetry (OTel) configuration in Claude Code on the Web (claude.ai/code)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When using Claude Code on the Web (claude.ai/code), there is no documented or reliable way to configure OpenTelemetry (OTel) telemetry export. The CLI version supports comprehensive OTel configuration via environment variables (CLAUDE_CODE_ENABLE_TELEMETRY, OTEL_METRICS_EXPORTER, OTEL_EXPORTER_OTLP_ENDPOINT, etc.), either through shell exports or ~/.claude/settings.json. However, in the Web version's sandboxed environment:
- No access to
~/.claude/settings.json— The sandbox is provisioned by Anthropic; users cannot pre-configure the home directory's settings file. - No shell-level environment variable injection — Users cannot export variables before the Claude Code process starts.
- Project-level
.claude/settings.jsonenv support is unclear — It is undocumented whetherenvfields in a repository's.claude/settings.jsonare applied in the Web environment. Related issue #13953 shows that some settings.json fields (e.g., agent configuration) are ignored on Web while others (e.g., hooks) work. - Network restrictions — The Web sandbox runs behind a security proxy with domain allowlisting. Even if OTel environment variables were set, outbound OTLP connections to external collectors (Grafana Cloud, Datadog, Honeycomb, etc.) would likely be blocked under the default "Limited" network configuration.
This makes it impossible for organizations to monitor Claude Code usage, costs, and tool activity when developers use the Web version — a significant gap compared to the CLI experience.
Proposed Solution
Option A: Support env in project-level .claude/settings.json on Web (minimum viable)
Ensure that env fields defined in a repository's .claude/settings.json are fully applied in the Web sandbox environment, including OTel-related variables:
// .claude/settings.json (committed to repository)
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "https://otlp-gateway.example.com/otlp",
"OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Basic <token>"
}
}
Caveats:
- Committing auth tokens to a repository is a security concern. Support for
.claude/settings.local.jsonor secrets injection would be needed. - The OTLP endpoint domain would need to be allowed through the network proxy (via "Full" internet or custom allowlist).
Option B: Support OTel configuration via Managed Settings / Admin Console
For Enterprise/Team plans, allow administrators to configure OTel environment variables through the Claude.ai Admin Console's managed settings. This would:
- Apply to all Web sessions organization-wide
- Keep credentials out of repositories
- Align with the existing managed settings architecture
Option C: Web UI configuration
Add an OTel configuration section in the Claude.ai Web interface (e.g., under Settings → Connectors or a new Monitoring section), where users can specify:
- OTLP endpoint URL
- Protocol (gRPC / HTTP)
- Authentication headers
- Export intervals
Alternative Solutions
Currently there is no known workaround to enable OTel telemetry export in the Web version of Claude Code. The sandboxed environment does not allow environment variable injection or access to ~/.claude/settings.json, and even if configuration were possible, outbound OTLP connections are likely blocked by the default network proxy.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
Enterprise Usage Monitoring
Organizations deploying Claude Code need to track token usage, API costs, and session activity across all interfaces (CLI, VS Code, and Web). Without OTel support on Web, usage data from Web sessions is invisible to the monitoring stack.
Cost Management
Teams using Claude Code on the Web cannot track cost-per-session or identify expensive usage patterns, making it difficult to manage budgets and justify ROI.
Compliance and Audit
For organizations that require an audit trail of AI tool usage, the Web version creates a blind spot in their observability pipeline.
Additional Context
Related Issues:
- #13953 — Agent setting in
.claude/settings.jsonis ignored on Claude Code for Web (demonstrates partial settings.json support on Web) - anthropics/claude-code-action#887 — Environment variables not passed to Claude Code subprocess in GitHub Actions (similar OTel env propagation issue in another remote context)
- #5508 — OpenTelemetry cannot be disabled on Windows (OTel configuration challenges)
- #19117 — Telemetry Configuration Ambiguity between Statsig and user-managed OTel
Additional Notes:
The Claude Code Monitoring documentation provides comprehensive OTel configuration guidance, but all instructions assume CLI or VS Code usage. There is no mention of Web (claude.ai/code) compatibility. Clarifying the Web version's OTel support status in the documentation would also be valuable, even if full support is not yet available.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗