Skip to content

(wip) feat(tracing): derive LLM Ops URL source param from span Source field#1428

Draft
saksharthakkar wants to merge 2 commits intomainfrom
feat/source_enum
Draft

(wip) feat(tracing): derive LLM Ops URL source param from span Source field#1428
saksharthakkar wants to merge 2 commits intomainfrom
feat/source_enum

Conversation

@saksharthakkar
Copy link
Contributor

@saksharthakkar saksharthakkar commented Mar 9, 2026

Summary

  • Add SOURCE_NAMES mapping (int → string) for SourceEnum values in _span_utils.py
  • Update LlmOpsHttpExporter._build_url() to derive the source URL query parameter from the span's Source field instead of hardcoding "Robots"
  • Default remains "Robots" (SourceEnum=4) when Source is missing or unknown
  • Fixes mismatch where agents sent Source: 1 (Agents) in span payload but source=Robots in URL

Test plan

  • New test test_build_url_uses_span_source covers: Agents(1), Robots(4), Playground(7), missing Source, unknown int(99)
  • Existing test_uipath_span_source_defaults_to_robots passes
  • Existing test_uipath_span_source_override_with_uipath_source passes
  • Full otel_exporters test suite (1590 tests) passes with no regressions
image

Previously the source query parameter in the LLM Ops API URL was
hardcoded to "Robots". Now it reads the Source field from the span
data (set via uipath.source attribute) and maps it to the correct
SourceEnum string name, defaulting to "Robots" if missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Mar 9, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant