Skip to content

feat(tracing): add coded agent info to traces#1522

Merged
ionmincu merged 1 commit intomainfrom
feature/add-trace-details
Mar 30, 2026
Merged

feat(tracing): add coded agent info to traces#1522
ionmincu merged 1 commit intomainfrom
feature/add-trace-details

Conversation

@ionmincu
Copy link
Copy Markdown
Contributor

@ionmincu ionmincu commented Mar 27, 2026

Description

  • Add codedAgentId, codedAgentName, and codedAgentVersion as default span attributes, read from UIPATH_PROCESS_UUID, UIPATH_PROCESS_KEY, and UIPATH_PROCESS_VERSION environment variables respectively. This enables identifying coded agents from trace data alone.
  • Add support for custom user-defined span attributes via UIPATH_TRACE_ATTR__ prefixed environment variables, following the ASP.NET Core configuration convention. For example, setting UIPATH_TRACE_ATTR__customerId=abc will inject customerId: "abc" into all span attributes.

How it works

Environment variables with the UIPATH_TRACE_ATTR__ prefix are scanned during span conversion in _SpanUtils.otel_span_to_uipath_span. The prefix is stripped and the remainder becomes the attribute key. This requires zero code changes from SDK users — just set env vars.

Development Packages

uipath

[project]
dependencies = [
  # Exact version:
  "uipath==2.10.36.dev1015225768",

  # Any version from PR
  "uipath>=2.10.36.dev1015220000,<2.10.36.dev1015230000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

uipath-platform

[project]
dependencies = [
  # Exact version:
  "uipath-platform==0.1.15.dev1015225768",

  # Any version from PR
  "uipath-platform>=0.1.15.dev1015220000,<0.1.15.dev1015230000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-platform = { index = "testpypi" }

@ionmincu ionmincu self-assigned this Mar 27, 2026
@github-actions github-actions Bot added the test:uipath-langchain Triggers tests in the uipath-langchain-python repository label Mar 27, 2026
@ionmincu ionmincu added the build:dev Create a dev build from the pr label Mar 27, 2026
@ionmincu ionmincu force-pushed the feature/add-trace-details branch 2 times, most recently from 8cf381e to 96aa7a4 Compare March 30, 2026 11:57
@ionmincu ionmincu force-pushed the feature/add-trace-details branch from 96aa7a4 to 37ea217 Compare March 30, 2026 15:47
Comment on lines +272 to +274
("PROJECT_KEY", "agentId"),
("UIPATH_PROCESS_KEY", "agentName"),
("UIPATH_PROCESS_VERSION", "agentVersion"),
Copy link
Copy Markdown
Member

@JosephMar JosephMar Mar 30, 2026

Choose a reason for hiding this comment

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

we already translate projectId and processVersion into AgentId and AgentVersion respectively for lowcode, @saksharthakkar can you point to where this is done (and check if it makes sense to converge some of this) so we don't duplicate attributes?

@ionmincu ionmincu force-pushed the feature/add-trace-details branch from 37ea217 to 5b6b8d7 Compare March 30, 2026 16:12
Add agent context attributes (agentId, agentName, agentVersion) from
environment variables to trace spans.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ionmincu ionmincu force-pushed the feature/add-trace-details branch from 592147f to 1538b9d Compare March 30, 2026 16:14
@ionmincu ionmincu merged commit b23ca6f into main Mar 30, 2026
118 checks passed
@ionmincu ionmincu deleted the feature/add-trace-details branch March 30, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants