Skip to content

feat(a2a): propagate caller trace and job context on remote A2A calls#929

Open
PopescuTudor wants to merge 1 commit into
mainfrom
feat/a2a-trace-propagation
Open

feat(a2a): propagate caller trace and job context on remote A2A calls#929
PopescuTudor wants to merge 1 commit into
mainfrom
feat/a2a-trace-propagation

Conversation

@PopescuTudor

@PopescuTudor PopescuTudor commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

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 traceparent is 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, traceparent construction, 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

@PopescuTudor PopescuTudor self-assigned this Jun 23, 2026
@PopescuTudor PopescuTudor force-pushed the feat/a2a-trace-propagation branch from 3aaeceb to 0a9f838 Compare June 23, 2026 16:51
@PopescuTudor PopescuTudor changed the title feat(a2a): propagate W3C trace context on remote A2A calls feat(a2a): propagate caller trace and job context on remote A2A calls Jun 23, 2026
@PopescuTudor PopescuTudor force-pushed the feat/a2a-trace-propagation branch from 0a9f838 to 4739163 Compare June 23, 2026 17:01
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
@PopescuTudor PopescuTudor force-pushed the feat/a2a-trace-propagation branch from 4739163 to 991f9c1 Compare June 23, 2026 17:10
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant