Skip to content

feat(cli): forward OTLP headers to child task processes - #4943

Closed
vjymisal0 wants to merge 1 commit into
triggerdotdev:mainfrom
vjymisal0:fix/expose-otel-headers
Closed

vjymisal0 wants to merge 1 commit into
triggerdotdev:mainfrom
vjymisal0:fix/expose-otel-headers

Conversation

@vjymisal0

Copy link
Copy Markdown

Summary

Child Node.js processes spawned by a task inherit the OTLP endpoint but not its exporter headers. As a result, a child process cannot configure NodeTracerProvider/OTLPTraceExporter to send spans to the current Trigger.dev run.

Preserve the optional OTEL_EXPORTER_OTLP_HEADERS value in RunnerEnv and forward it through gatherProcessEnv(), alongside the existing endpoint variables. Child processes can now use the standard OpenTelemetry environment configuration without IPC.

Test plan

  • corepack pnpm exec oxlint packages/cli-v3/src/entryPoints/managed/env.ts
  • corepack pnpm exec oxfmt --check packages/cli-v3/src/entryPoints/managed/env.ts
  • git diff --check

The full CLI typecheck is currently blocked by pre-existing workspace generation errors (@trigger.dev/schema-to-json and @trigger.dev/database declarations).

Fixes #4766

@changeset-bot

changeset-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 538a766

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 54a047cb-2894-4f32-85fe-377b56cda39f

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4ac50 and 538a766.

📒 Files selected for processing (1)
  • packages/cli-v3/src/entryPoints/managed/env.ts

Walkthrough

RunnerEnv now accepts optional OTEL_EXPORTER_OTLP_HEADERS values. It exposes the value through a getter and includes defined values in the environment passed to child processes.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @vjymisal0, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Sep 16, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 User-facing fix lacks changeset

This deployed-task fix changes public CLI behavior without a changeset. Repository rules require release notes for user-visible package fixes.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +38 to +39
// Forward the run-scoped exporter credentials so child processes can export spans to the run.
OTEL_EXPORTER_OTLP_HEADERS: z.string().optional(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟥 OTLP credentials leak into logs

When OTEL_EXPORTER_OTLP_HEADERS contains credentials, rawForLogging exposes them. Controller startup logs then print the credentials and can send them upstream.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

feat: Allow to record spans from nodejs child process

1 participant