[Bug] OTEL environment variables propagate to child processes causing unintended telemetry
Bug Description
OTEL environment variables propagate to child processes, causing unintended telemetry from third-party tools
When configuring OpenTelemetry via managed settings (env block), the OTEL_* environment variables are inherited by all child processes spawned by Claude Code (e.g., Docker Compose, OrbStack). These tools auto-detect the standard OTEL env vars and start sending their own telemetry to the configured endpoint (in our case, Honeycomb), creating noise and unwanted cost.
Current behavior: OTEL_* env vars set in managed settings propagate to all subprocess environments.
Expected behavior: OTEL configuration should only affect Claude Code's own telemetry, not leak to child processes.
Suggested solutions (any of these would help):
A non-env-var configuration path for OTEL (e.g., dedicated otel key in settings.json)
Automatically strip OTEL_* vars from child process environments (similar to how CLAUDE_CODE_SUBPROCESS_ENV_SCRUB handles credentials)
An env_exclude or subprocess_env_scrub_patterns setting to let admins specify env var patterns to strip from child processes
Context: We deployed OTEL config company-wide via server-managed settings. This is a blocker for clean observability at scale.
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.97
- Feedback ID: 205056d9-18e1-4474-a7b3-ce069355f945
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗