Request: Add telemetry debugging capabilities for Docker container environments
Problem Summary
Claude Code telemetry works perfectly when running locally, but fails silently when running inside a Docker container in our CI environment. There is currently no way to debug telemetry failures because Claude Code does not provide sufficient logging around telemetry operations.
Environment Details
- Claude Code Version: 1.0.2
- Environment: Docker container in GitHub Actions CI
- Platform: Linux container
- Telemetry Endpoint: Internal OTEL collector
What Works
✅ Local execution: When running Claude Code locally with the same OTEL configuration, telemetry works perfectly and data appears in our collector
✅ Manual telemetry test: Can successfully send telemetry from both local machine and inside the Docker container using a test script via curl
✅ Network connectivity: Container can reach the telemetry endpoint (verified with curl)
✅ Certificates: Container has proper CA certificates configured
What Doesn't Work
❌ Docker container execution: Claude Code silently fails to send telemetry when running in the Docker container, but provides no error messages or debug information
Current Configuration
Environment Variables (Docker)
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_EXPORTER_OTLP_ENDPOINT=https://internal.telemetry:443
Docker Configuration
- Base images with proper CA certificates
- Corporate proxy configuration
- Network access to telemetry endpoint verified
- Node.js environment with proper SSL configuration
Debugging Attempts
- OTEL_LOG_LEVEL=debug: Enabled debug logging but unable to see any log entries
- OTEL_LOG_LEVEL=trace: Same result - no telemetry transmission details
- Manual curl tests: Verified the endpoint is reachable and accepts data
- Network debugging: Confirmed DNS resolution and SSL certificate validation work
- Environment variable verification: All variables are properly set in the container
The Core Issue
Claude Code provides no visibility into telemetry failures. When telemetry fails to send, there are no error messages, no debug logs showing:
- Whether requests are being made
- What responses are received
- What errors occur during transmission
- Whether certificates are being validated properly
- Network-level failures
Feature Request
Claude Code should provide telemetry debugging capabilities, such as:
- Debug flag support:
claude --otel-debugshould enable verbose telemetry logging - Telemetry-specific logging: Show HTTP requests/responses when telemetry is enabled
- Error reporting: Log telemetry failures with specific error details
- Connection validation: Log certificate validation, DNS resolution, and network connectivity issues
- Environment validation: Warn about missing or invalid OTEL configuration
Example of What We Need
When --otel-debug flag is passed or CLAUDE_CODE_DEBUG_TELEMETRY=1 is set, we should see output like:
[TELEMETRY] Initializing OTEL with endpoint: https://internal.telemetry.gcpnp.anz:443
[TELEMETRY] Resource attributes: team.id=lotus-platform,team.user=depaular
[TELEMETRY] Sending span data...
[TELEMETRY] HTTP POST https://internal.telemetry.gcpnp.anz:443/v1/traces
[TELEMETRY] Response: 200 OK (Content-Length: 25)
[TELEMETRY] ✓ Telemetry sent successfully
Or in case of failure:
[TELEMETRY] Initializing OTEL with endpoint: https://internal.telemetry.gcpnp.anz:443
[TELEMETRY] Sending span data...
[TELEMETRY] HTTP POST https://internal.telemetry.gcpnp.anz:443/v1/traces
[TELEMETRY] ✗ Request failed: connect ECONNREFUSED 10.1.2.3:443
[TELEMETRY] Certificate validation failed: unable to verify the first certificate
Impact
This issue affects enterprise users who:
- Run Claude Code in Docker containers (common in CI/CD)
- Need telemetry for compliance/monitoring requirements
- Cannot debug telemetry issues due to lack of visibility
Workaround
Currently, there is no effective workaround. The only option is to disable telemetry in Docker environments, which defeats the purpose of having telemetry in the first place.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗