From a4de2d09e9d4b55674b8ea759ef92b6d75ef40fd Mon Sep 17 00:00:00 2001 From: Brent Shulman <134343004+brentshulman-silkline@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:31:07 -0400 Subject: [PATCH 1/2] fix(cli-v3): forward TRIGGER_WORKER_INSTANCE_NAME into managed run process env --- packages/cli-v3/src/entryPoints/managed/env.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli-v3/src/entryPoints/managed/env.ts b/packages/cli-v3/src/entryPoints/managed/env.ts index 4da8361e863..18af293cf22 100644 --- a/packages/cli-v3/src/entryPoints/managed/env.ts +++ b/packages/cli-v3/src/entryPoints/managed/env.ts @@ -236,6 +236,11 @@ export class RunnerEnv { OTEL_EXPORTER_OTLP_ENDPOINT: this.OTEL_EXPORTER_OTLP_ENDPOINT, TRIGGER_OTEL_EXPORTER_OTLP_ENDPOINT: this.OTEL_EXPORTER_OTLP_ENDPOINT, UV_USE_IO_URING: this.UV_USE_IO_URING, + // Forward the worker instance name (spec.nodeName on k8s) into the run + // process so it can be attached as an OTEL host/node resource attribute. + // Without this, run spans/logs exported to an off-node OTLP collector + // have no host and Datadog tags them issue_type:empty_hostname. + TRIGGER_WORKER_INSTANCE_NAME: this.TRIGGER_WORKER_INSTANCE_NAME, }; // Filter out undefined values From dcd100bf0927e1984f11fb6dc1bf3d59f3e67d18 Mon Sep 17 00:00:00 2001 From: Brent Shulman <134343004+brentshulman-silkline@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:31:08 -0400 Subject: [PATCH 2/2] chore: add changeset for TRIGGER_WORKER_INSTANCE_NAME env forward --- .changeset/forward-worker-instance-name.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .changeset/forward-worker-instance-name.md diff --git a/.changeset/forward-worker-instance-name.md b/.changeset/forward-worker-instance-name.md new file mode 100644 index 00000000000..368645255e4 --- /dev/null +++ b/.changeset/forward-worker-instance-name.md @@ -0,0 +1,14 @@ +--- +"trigger.dev": patch +--- + +Forward `TRIGGER_WORKER_INSTANCE_NAME` into the managed run process env + +The Kubernetes workload manager already injects `TRIGGER_WORKER_INSTANCE_NAME` +(= `spec.nodeName`) into the run-controller container via the downward API, but +the managed run worker is forked with an explicit env allowlist +(`RunnerEnv.gatherProcessEnv()`) that dropped it. As a result the run process +could not attach the node as an OpenTelemetry `host.name` resource attribute, so +spans/logs exported to an off-node OTLP collector had no host (Datadog tags these +`issue_type:empty_hostname`). This forwards the value so `trigger.config.ts` +telemetry (or the worker itself) can surface the node/host.