[BUG] OTEL_RESOURCE_ATTRIBUTES does not apply to logs

Resolved 💬 4 comments Opened Jul 24, 2025 by nsheaps Closed Jul 24, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: Claude Code
  • Claude CLI version: 1.0.59
  • Operating System: macos 15.5
  • Terminal: iterm + vscode terminal

Bug Description

The docs describe using this environment variable to add additional attributes to metrics and events (logs)
https://docs.anthropic.com/en/docs/claude-code/monitoring-usage

When setting this variable the attributes do not appear on the log messages

Steps to Reproduce

  1. Preexisting OTEL setup (logging to newrelic)
  2. Set environment variable
  3. Note that the attributes do not show up on the logs

Expected Behavior

Attributes show on logs

Actual Behavior

No attributes on logs, though the do show through the traces that I manually track with otel-cli
Related: https://github.com/anthropics/claude-code/issues/4339

View original on GitHub ↗

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