Title: fix(cli-v3): forward TRIGGER_WORKER_INSTANCE_NAME into the managed run process env by brentshulman-silkline · Pull Request #4213 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: fix(cli-v3): forward TRIGGER_WORKER_INSTANCE_NAME into the managed run process env by brentshulman-silkline · Pull Request #4213 · triggerdotdev/trigger.dev
X Title: fix(cli-v3): forward TRIGGER_WORKER_INSTANCE_NAME into the managed run process env by brentshulman-silkline · Pull Request #4213 · triggerdotdev/trigger.dev
Description: Problem On self-hosted Kubernetes, task-run spans and logs exported over OTLP to an off-node collector (e.g. a central Datadog Agent) have an empty host. Datadog tags every such span with issue_type:empty_hostname. There is no supported way for a user's trigger.config.ts telemetry resource to recover the node, because the node identity never reaches the run process. Root cause The Kubernetes workload manager already injects the node name into the run-controller container via the downward API (apps/supervisor/src/workloadManager/kubernetes.ts): { name: "TRIGGER_WORKER_INSTANCE_NAME", valueFrom: { fieldRef: { fieldPath: "spec.nodeName" } } } But the actual task-run worker is fork()ed with an explicit, replaced env built from RunnerEnv.gatherProcessEnv() (an allowlist) plus the run's env (packages/cli-v3/src/entryPoints/managed/taskRunProcessProvider.ts → packages/cli-v3/src/executions/taskRunProcess.ts). gatherProcessEnv() returns only NODE_ENV, NODE_EXTRA_CA_CERTS, OTEL_EXPORTER_OTLP_ENDPOINT, TRIGGER_OTEL_EXPORTER_OTLP_ENDPOINT, UV_USE_IO_URING, so TRIGGER_WORKER_INSTANCE_NAME (and container-level vars generally) never reach process.env in the run process. The node identity is present in the pod but dropped before it can be used. Fix Add TRIGGER_WORKER_INSTANCE_NAME to the env returned by RunnerEnv.gatherProcessEnv() (it is already in the Env schema and has a getter). One line + comment; see change.diff. With this, a user can map it in their trigger.config.ts: const nodeName = process.env.TRIGGER_WORKER_INSTANCE_NAME; // spec.nodeName on k8s telemetry: { resource: resourceFromAttributes( nodeName ? { "host.name": nodeName, "k8s.node.name": nodeName } : {} ), // ... } which clears empty_hostname and attributes the run to its actual node. Scope / risk Additive: forwards one already-present, non-secret identity var. No behavior change when unset (the existing undefined filter drops it). Docker workload manager already passes TRIGGER_WORKER_INSTANCE_NAME to the runner (workloadManager/docker.ts), so this aligns k8s runs with that. Changeset trigger.dev: patch — see changeset.md.
Open Graph Description: Problem On self-hosted Kubernetes, task-run spans and logs exported over OTLP to an off-node collector (e.g. a central Datadog Agent) have an empty host. Datadog tags every such span with issue_typ...
X Description: Problem On self-hosted Kubernetes, task-run spans and logs exported over OTLP to an off-node collector (e.g. a central Datadog Agent) have an empty host. Datadog tags every such span with issue_typ...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4213
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bd9a293e-7f28-6749-ae06-c1333f604b39 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DFF2:1FB20:33E99ED:4A4BAF3:6AFB0743 |
| html-safe-nonce | 114f925ade97b39a976f5835140cf6c0a9e62b655f91cd4910d6febfe2faa509 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkYyOjFGQjIwOjMzRTk5RUQ6NEE0QkFGMzo2QUZCMDc0MyIsInZpc2l0b3JfaWQiOiI3MjE0MzU1MDkxMTQwODM5MjM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 51f861a6a740044a8f454567aa04341cd7ad14ea0c33d90549c7523935c97337 |
| hovercard-subject-tag | pull_request:4023858698 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4213/files |
| twitter:image | https://avatars.githubusercontent.com/u/134343004?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/134343004?s=400&v=4 |
| og:image:alt | Problem On self-hosted Kubernetes, task-run spans and logs exported over OTLP to an off-node collector (e.g. a central Datadog Agent) have an empty host. Datadog tags every such span with issue_typ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 76fb13cb43f1834708971f45a9cfcab5df3177a7582086613d7cdc6e98c4bfde |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | afc998826cdd963c8f91a96ae5372809ab5e296b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width