Add OpenTelemetry environment variable support#10
Open
ivancasco wants to merge 1 commit intoanthropics:mainfrom
Open
Add OpenTelemetry environment variable support#10ivancasco wants to merge 1 commit intoanthropics:mainfrom
ivancasco wants to merge 1 commit intoanthropics:mainfrom
Conversation
Pass OTEL configuration environment variables through to Claude Code to enable observability and tracing. Supported OTEL env vars from Claude Code documentation: - CLAUDE_CODE_ENABLE_TELEMETRY (required to enable telemetry) - OTEL_METRICS_EXPORTER - OTEL_EXPORTER_OTLP_PROTOCOL - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_EXPORTER_OTLP_HEADERS - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE - OTEL_METRIC_EXPORT_INTERVAL - OTEL_METRICS_INCLUDE_SESSION_ID - OTEL_METRICS_INCLUDE_VERSION - OTEL_METRICS_INCLUDE_ACCOUNT_UUID 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
sid374
requested changes
May 27, 2025
sid374
left a comment
There was a problem hiding this comment.
We should lean on the settings.json files (docs here: https://docs.anthropic.com/en/docs/claude-code/settings) to set up these env variables instead of defining them explicitly in the action.
The env vars you have listed here are only a small subset of the supported OTEL env vars, and we'd end up writing more config here every time we discover a new one that's useful. Instead the flow should be:
- Create a .claude/settings.json in your repo and check it in or create it as a separate workflow step before calling the claude action if you'd like to use Secrets
- Add this to your settings.json + any additional OTEL env vars
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp"
}
- Continue...
We will also update our docs to reflect this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass OTEL configuration environment variables through to Claude Code to enable observability and tracing.
Supported OTEL env vars from Claude Code documentation:
🤖 Generated with Claude Code