[BUG] Claude Code telemetry not sending data to OTEL collector
Claude Code telemetry not sending data to local OTEL collector
Summary
Claude Code appears to not be sending telemetry data to a configured local OpenTelemetry collector, despite correct configuration and a verified working collector setup.
Environment
- Platform: macOS (Darwin 24.3.0)
- Claude Code model: Sonnet 4
Configuration
My ~/.claude/settings.json includes:
{
"telemetry": {
"enabled": true,
"logLevel": "debug",
"otel": {
"endpoint": "http://127.0.0.1:4318",
"protocol": "http/protobuf",
"metricsExporter": ["console", "otlp"],
"logsExporter": ["console", "otlp"],
"headers": {},
"timeout": 5000
}
}
}
Expected Behavior
Claude Code should send telemetry data (metrics and logs) to the configured OTEL collector endpoint.
Actual Behavior
No telemetry data appears in the OTEL collector logs or exported files, despite:
- Telemetry being enabled
- Correct endpoint configuration
- Multiple Claude Code interactions over time
- Restarting Claude Code after configuration changes
Verification Steps
I verified the setup is correct by:
- OTEL Collector is running and functional: Docker Compose setup with otel/opentelemetry-collector-contrib:latest
- Endpoint is accessible: Manual curl tests successfully send data to both
localhost:4318and127.0.0.1:4318 - Collector receives and processes data: Test metrics appear in debug logs and exported JSON files
- Port is listening:
netstatconfirms port 4318 is open and accessible
Example successful manual test:
curl -X POST http://127.0.0.1:4318/v1/metrics \
-H "Content-Type: application/json" \
-d '{"resourceMetrics":[...]}' # Returns {"partialSuccess":{}}
This test data immediately appears in the collector logs with full debug output.
Troubleshooting Attempted
- Changed endpoint from
localhost:4318to127.0.0.1:4318 - Added
"logLevel": "debug"to telemetry configuration - Restarted Claude Code after configuration changes
- Verified collector configuration includes all signal types (traces, metrics, logs)
- Confirmed collector debug exporter shows detailed output for manual test data
Collector Configuration
Using standard OTLP receiver on HTTP protocol with debug and file exporters. The collector successfully processes manually sent telemetry data but receives nothing from Claude Code.
Conclusion
The evidence suggests Claude Code's telemetry system is not functioning as configured. The collector setup is verified working, the endpoint is accessible, and the configuration appears correct according to available documentation.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗