Repository navigation
fix(env): pass through OpenTelemetry variables - #927
Open
jasonkuhrt wants to merge 4 commits into
Open
jasonkuhrt wants to merge 4 commits into
jasonkuhrt wants to merge 4 commits into
Conversation
OpenTelemetry SDKs read their exporter settings from `OTEL_*` variables. Cached tasks got none of them unless each task listed `OTEL_*` in its `untrackedEnv`, while uncached tasks got the whole environment. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…acked Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
This branch has not been deployed
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.
Motivation
Add
OTEL_*,TRACEPARENT,TRACESTATE, andBAGGAGEtoDEFAULT_UNTRACKED_ENVso cached tasks pass through OpenTelemetry exporter settings and context-propagation carriers by default without entering task cache keys.OpenTelemetry SDKs read exporter settings (
OTEL_EXPORTER_OTLP_ENDPOINT,OTEL_SERVICE_NAME, and so on) from the process environment, and tools that extract W3C context across process boundaries follow the stable OpenTelemetry Environment Variable Carriers specification (TRACEPARENT,TRACESTATE,BAGGAGE). Because the default allowlist omits these variables, a cached task receives none of them unless its config opts in viauntrackedEnv(orenv, which hashes their values). An uncached task inherits the whole environment, so the same tool exports and correlates traces or silently skips it depending on whether the task is cached.Today we inject
OTEL_*into every cached task'suntrackedEnvwhen configs load, and preserving parent trace context (TRACEPARENT,TRACESTATE) and baggage (BAGGAGE) across cached tasks would otherwise require injecting those carriers into every cached task'suntrackedEnvas well. #691 addedACTIONS_ID_TOKEN_REQUEST_URLtoDEFAULT_UNTRACKED_ENVfor the same reason: tools inside cached tasks need well-known environment variables that individual task configs should not have to repeat.Changes
OTEL_*,TRACEPARENT,TRACESTATE, andBAGGAGEjoinDEFAULT_UNTRACKED_ENV, with a unit test beside #691's.For a cached task with no custom
untrackedEnvwhenOTEL_SERVICE_NAME,TRACEPARENT,TRACESTATE, andBAGGAGEare set in the caller's environment:OTEL_SERVICE_NAME,TRACEPARENT,TRACESTATE,BAGGAGE)TRACEPARENTvite-plus@1.8.0(vp run check)null(filtered out)!NAMEinuntrackedEnvor fingerprint one by listing it inenv.untrackedEnvpattern set changes get a one-time fingerprint change (EnvFingerprints::untracked_env_config); tasks that already list all four patterns keep the same deduplicated set.