Skip to content

Conversation

@zhming0
Copy link
Contributor

@zhming0 zhming0 commented Oct 21, 2025

Description

This PR addresses a our long standing OpenTelemetry gap, mentioned in #1663: we don't tell our Agent's child processes what our current span id and trace id is. It means our current OpenTelemetry integration only offer observability to job level, nothing more granular below that.

We had this feature implemented for the deprecated opentracing backend a long time ago, this PR filled the gap for OpenTelemetry.

This PR conforms to OTel env carrier standard, whenever Agent starts an child processes, it will try to propagate current OpenTel Span context to child processes via environment variables.

This PR takes inspiration from Intercom's implementation intercom#1, but aim to be more standard compliant and sustainable.

Context

PS-1295

Testing

  • Tests have run locally (with go test ./...). Buildkite employees may check this if the pipeline has run automatically.
  • Code is formatted (with go fmt ./...)
Screenshot 2025-10-21 at 4 31 40 PM

Disclosures / Credits

Human

@zhming0 zhming0 requested review from a team and catkins October 21, 2025 05:42
Copy link
Member

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

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

This looks like a great change, love the context and focus on compatabilty.

Copy link
Contributor

@catkins catkins left a comment

Choose a reason for hiding this comment

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

Amazing! Thanks @zhming0

@zhming0 zhming0 merged commit e2dddb9 into main Oct 22, 2025
1 check passed
@zhming0 zhming0 deleted the ming/ps-1295 branch October 22, 2025 01:00
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.

4 participants