Skip to content

fix(env): pass through OpenTelemetry variables - #927

Open
jasonkuhrt wants to merge 4 commits into
voidzero-dev:mainfrom
jasonkuhrt:fix/otel-default-untracked
Open

jasonkuhrt wants to merge 4 commits into
voidzero-dev:mainfrom
jasonkuhrt:fix/otel-default-untracked

Conversation

@jasonkuhrt

@jasonkuhrt jasonkuhrt commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Written by an AI agent (Antigravity) on behalf of @jasonkuhrt.

Motivation

Add OTEL_*, TRACEPARENT, TRACESTATE, and BAGGAGE to DEFAULT_UNTRACKED_ENV so 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 via untrackedEnv (or env, 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's untrackedEnv when 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's untrackedEnv as well. #691 added ACTIONS_ID_TOKEN_REQUEST_URL to DEFAULT_UNTRACKED_ENV for 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, and BAGGAGE join DEFAULT_UNTRACKED_ENV, with a unit test beside #691's.

For a cached task with no custom untrackedEnv when OTEL_SERVICE_NAME, TRACEPARENT, TRACESTATE, and BAGGAGE are set in the caller's environment:

Build Task sees (OTEL_SERVICE_NAME, TRACEPARENT, TRACESTATE, BAGGAGE) Re-run with a new TRACEPARENT
vite-plus@1.8.0 (vp run check) all null (filtered out) — (not passed through)
This branch all four values passed through cache hit (values not fingerprinted)
  • By default, these variables reach cached tasks and their values do not enter the cache key; a task can still exclude any of them via !NAME in untrackedEnv or fingerprint one by listing it in env.
  • Cached tasks whose effective untrackedEnv pattern set changes get a one-time fingerprint change (EnvFingerprints::untracked_env_config); tasks that already list all four patterns keep the same deduplicated set.

Written by an AI agent (Antigravity) on behalf of @jasonkuhrt.

jasonkuhrt and others added 4 commits November 2, 2026 07:22
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant