feat(a2a): propagate caller trace and job context on remote A2A calls#929
Open
PopescuTudor wants to merge 1 commit into
Open
feat(a2a): propagate caller trace and job context on remote A2A calls#929PopescuTudor wants to merge 1 commit into
PopescuTudor wants to merge 1 commit into
Conversation
3aaeceb to
0a9f838
Compare
0a9f838 to
4739163
Compare
Set the A2A client's default headers to carry the running job's W3C `traceparent` (`UIPATH_TRACE_ID`, parented at `UIPATH_PARENT_SPAN_ID` when set) and its `X-UiPath-JobKey`, so the remote proxy can correlate the call's spans with the calling job's trace and group them under that job. Nothing extra is sent outside a job context. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELDu3m5eaURJrMVarc8VfY
4739163 to
991f9c1
Compare
|
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.



What
Set the A2A client's default headers to carry the calling job's correlation context, so the remote A2A proxy can correlate the call's spans with the calling job's trace and group them under that job:
traceparent— the job's trace id (UIPATH_TRACE_ID, normalized to 32-char hex), parented at the job's root span (UIPATH_PARENT_SPAN_ID) when set, falling back to the current OTel span id or a minted span id.X-UiPath-JobKey— the job key (UIPATH_JOB_KEY), matching the header the runtime already sends to other UiPath proxies.Nothing extra is sent outside a job context. The
traceparentis set explicitly rather than relying on httpx auto-instrumentation, because the runtime binds the job trace id only at export time — the in-process OTel context carries a different id, so auto-propagation would send the wrong trace id.Tests
Unit tests for trace-id normalization, span-id coercion,
traceparentconstruction, and header assembly (tests/agent/tools/test_a2a_tool.py). Lint (ruff, custom httpx-client check) and the circular-import guard pass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01ELDu3m5eaURJrMVarc8VfY