mirror of
https://github.com/anthropics/claude-code-action.git
synced 2026-08-22 03:18:54 +08:00
fix: pass OpenTelemetry environment variables to Claude Code subprocess (#886)
* fix: pass OpenTelemetry environment variables to Claude Code subprocess Environment variables set in workflow's step `env:` block were not being passed to the Claude Code subprocess because composite actions only forward explicitly referenced environment variables. This fix adds references for telemetry-related environment variables: - CLAUDE_CODE_ENABLE_TELEMETRY - OTEL_METRICS_EXPORTER - OTEL_LOGS_EXPORTER - OTEL_EXPORTER_OTLP_PROTOCOL - OTEL_EXPORTER_OTLP_ENDPOINT - OTEL_METRIC_EXPORT_INTERVAL - OTEL_LOGS_EXPORT_INTERVAL - OTEL_RESOURCE_ATTRIBUTES Co-Authored-By: 조상연[플레이스 AI] <sang-yeon.cho@navercorp.com> Co-Authored-By: csy1204 <josang1204@gmail.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test: add tests for OTEL environment variables passthrough Verify that telemetry-related environment variables are correctly passed through to sdkOptions.env when set in process.env. Co-Authored-By: 조상연[플레이스 AI] <sang-yeon.cho@navercorp.com> Co-Authored-By: csy1204 <josang1204@gmail.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: add missing OTEL_EXPORTER_OTLP_HEADERS environment variable Add OTEL_EXPORTER_OTLP_HEADERS to the list of OpenTelemetry environment variables passed through to the Claude Code subprocess. This variable is needed for authentication when connecting to OTLP endpoints that require bearer tokens or other credentials. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: 조상연[플레이스 AI] <sang-yeon.cho@navercorp.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
조상연[플레이스 AI] <sang-yeon.cho@navercorp.com>
parent
70e16deb18
commit
fab4258c6e
+11
@@ -312,6 +312,17 @@ runs:
|
||||
ANTHROPIC_DEFAULT_HAIKU_MODEL: ${{ env.ANTHROPIC_DEFAULT_HAIKU_MODEL }}
|
||||
ANTHROPIC_DEFAULT_OPUS_MODEL: ${{ env.ANTHROPIC_DEFAULT_OPUS_MODEL }}
|
||||
|
||||
# Telemetry configuration
|
||||
CLAUDE_CODE_ENABLE_TELEMETRY: ${{ env.CLAUDE_CODE_ENABLE_TELEMETRY }}
|
||||
OTEL_METRICS_EXPORTER: ${{ env.OTEL_METRICS_EXPORTER }}
|
||||
OTEL_LOGS_EXPORTER: ${{ env.OTEL_LOGS_EXPORTER }}
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: ${{ env.OTEL_EXPORTER_OTLP_PROTOCOL }}
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ env.OTEL_EXPORTER_OTLP_ENDPOINT }}
|
||||
OTEL_EXPORTER_OTLP_HEADERS: ${{ env.OTEL_EXPORTER_OTLP_HEADERS }}
|
||||
OTEL_METRIC_EXPORT_INTERVAL: ${{ env.OTEL_METRIC_EXPORT_INTERVAL }}
|
||||
OTEL_LOGS_EXPORT_INTERVAL: ${{ env.OTEL_LOGS_EXPORT_INTERVAL }}
|
||||
OTEL_RESOURCE_ATTRIBUTES: ${{ env.OTEL_RESOURCE_ATTRIBUTES }}
|
||||
|
||||
- name: Update comment with job link
|
||||
if: steps.prepare.outputs.contains_trigger == 'true' && steps.prepare.outputs.claude_comment_id && always()
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user