Conversation
8 tasks
…trace hierarchy (#issue) Agent-Logs-Url: https://github.com/github/gh-aw/sessions/5f39e758-51a4-4d6f-a422-546b4acd439e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve OTel propagation of parent span ID through aw_context
feat(otel): propagate parent span ID through aw_context for cross-job trace hierarchy
Apr 9, 2026
pelikhan
approved these changes
Apr 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes cross-workflow trace hierarchy in OTLP by propagating the parent job’s setup span ID through aw_context and using it as parentSpanId for dispatched child workflow setup spans, so traces render as a single nested tree instead of disconnected roots.
Changes:
- Add
otel_parent_span_idtoaw_context(sourced fromGITHUB_AW_OTEL_PARENT_SPAN_ID) to propagate the parent setup span across workflow dispatch boundaries. - Update
sendJobSetupSpanto readaw_info.context.otel_parent_span_id, validate it, and pass it tobuildOTLPPayloadasparentSpanId. - Add tests to verify valid propagation, omission when absent, and omission when invalid.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/aw_context.cjs | Extends dispatched aw_context with otel_parent_span_id to carry parent setup span ID to child workflows. |
| actions/setup/js/send_otlp_span.cjs | Uses propagated otel_parent_span_id (when valid) as parentSpanId on the child job setup span payload. |
| actions/setup/js/send_otlp_span.test.cjs | Adds coverage for propagation/absence/invalid cases for otel_parent_span_id → parentSpanId. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Child workflow setup spans were sent with no
parentSpanId, causing multi-job dispatch traces to appear as disconnected root spans in every OTel backend instead of a properly nested tree.Changes
aw_context.cjs—buildAwContext()now includesotel_parent_span_idfromGITHUB_AW_OTEL_PARENT_SPAN_ID, mirroring the existingotel_trace_id/GITHUB_AW_OTEL_TRACE_IDpropagationsend_otlp_span.cjs—sendJobSetupSpanreadsawInfo.context.otel_parent_span_idand passes it asparentSpanIdtobuildOTLPPayload, linking the child setup span under the parent's setup spansend_otlp_span.test.cjs— three new tests covering valid propagation, absent field, and invalid span ID rejectionResult
Child job setup spans in dispatched workflows now carry the parent job's span ID: