Skip to content

Conversation

@dannyfallon
Copy link

Currently the Buildkite agent only enables propagation to spawned processes for OpenTracing (Datadog) and not for OpenTelemetry. We have a need for the spawned process, which uses Otel, to access the trace parent of the span that did the spawning. All that's currently available is the BUILDKITE_TRACING_TRACEPARENT env variable which is the span that was triggered by the Buildkite remote serve/pipeline product for buildkite.job rather than any span generated by the actual agent itself.

With this PR we're going to leverage the W3C standard and set the TRACEPARENT env variable when we shell out to a process and the span used will be the span that's open in the agent.

We anticipate this to be reasonably short-lived as a change because it's filling the gap of buildkite#1663 for our own purposes. Buildkite hope to prioritise this in their agent at some point in the future so keep an eye on that issue for when this patch may no longer be needed.

Currently the Buildkite agent only enables propagation to spawned
processes for OpenTracing (Datadog) and not for OpenTelemetry. We
have a need for the spawned process, which uses Otel, to access the
trace parent of the span that did the spawning. All that's currently
available is the `BUILDKITE_TRACING_TRACEPARENT` env variable which
is the span that was triggered by the Buildkite remote serve/pipeline
product for `buildkite.job` rather than any span generated by the
actual agent itself.

With this PR we're going to leverage the W3C standard and set the
`TRACEPARENT` env variable when we shell out to a process and the
span used will be the span that's open in the agent.

We anticipate this to be reasonably short-lived as a change because
it's filling the gap of buildkite#1663
for our own purposes. Buildkite hope to prioritise this in their agent
at some point in the future so keep an eye on that issue for when this
patch may no longer be needed.
@dannyfallon dannyfallon merged commit 5b60010 into main Oct 17, 2025
2 checks passed
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.

3 participants