Skip to content

fix(tracing): use agentId as span reference_id#1635

Closed
ionmincu wants to merge 1 commit into
mainfrom
fix/traces-reference-id-from-agent-id_3
Closed

fix(tracing): use agentId as span reference_id#1635
ionmincu wants to merge 1 commit into
mainfrom
fix/traces-reference-id-from-agent-id_3

Conversation

@ionmincu
Copy link
Copy Markdown
Contributor

Summary

  • Set UiPathSpan.reference_id from the agentId attribute (sourced from the PROJECT_KEY env var) instead of the unset referenceId attribute, so coded-agent spans carry a meaningful reference back to their agent.

Supersedes #1634 / #1628 — scope narrowed to only the _span_utils.py change (the workflow changes have been dropped from this PR).

Test plan

  • Verify emitted spans include ReferenceId matching the project/agent id

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 18, 2026 08:45
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels May 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates span conversion in uipath-platform so exported UiPathSpan.ReferenceId is populated from the agent/project identifier, improving trace-to-agent correlation for coded-agent spans.

Changes:

  • Set UiPathSpan.reference_id from the OTel agentId attribute (which is populated from PROJECT_KEY) instead of referenceId.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

execution_type = attributes_dict.get("executionType")
agent_version = attributes_dict.get("agentVersion")
reference_id = attributes_dict.get("referenceId")
reference_id = attributes_dict.get("agentId")
Comment on lines 283 to 287
# Top-level fields for internal tracing schema
execution_type = attributes_dict.get("executionType")
agent_version = attributes_dict.get("agentVersion")
reference_id = attributes_dict.get("referenceId")
reference_id = attributes_dict.get("agentId")

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants