Skip to content

Go SDK: Propagate OTel context to Go SDK tasks#70166

Open
viiccwen wants to merge 1 commit into
apache:mainfrom
viiccwen:go-sdk-propagate-otel-context
Open

Go SDK: Propagate OTel context to Go SDK tasks#70166
viiccwen wants to merge 1 commit into
apache:mainfrom
viiccwen:go-sdk-propagate-otel-context

Conversation

@viiccwen

Copy link
Copy Markdown
Contributor

Closes #70165.

Go SDK tasks executed through the bundle gRPC path currently don't have the task instance's OpenTelemetry context carrier. This breaks trace continuity at the Go task boundary even though the protobuf schema already provides an otel_context field.

This change:

  • forwards string-valued context-carrier entries through the existing bundle protobuf field.
  • reconstructs the carrier when the bundle server receives the workload.
  • extracts the W3C Trace Context into the task's context.Context, allowing task instrumentation and downstream API calls to inherit the remote parent.

Was generative AI tooling used to co-author this PR?
  • Yes - GPT-5.6 Sol

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Go tasks currently lose their remote parent at the bundle boundary, which breaks trace continuity and prevents task instrumentation from joining the scheduler-created trace.

Signed-off-by: viiccwen <vicwen@apache.org>
@viiccwen

Copy link
Copy Markdown
Contributor Author

cc @jason810496, @henry3260. 🙌

@viiccwen viiccwen changed the title Propagate OTel context to Go SDK tasks Go SDK: Propagate OTel context to Go SDK tasks Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Propagate OpenTelemetry context to Go SDK tasks

1 participant