(wip) feat(tracing): migrate span ingestion to v3 API with string enums#1684
Draft
saksharthakkar wants to merge 12 commits into
Draft
(wip) feat(tracing): migrate span ingestion to v3 API with string enums#1684saksharthakkar wants to merge 12 commits into
saksharthakkar wants to merge 12 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…vel StrEnums Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rEnum types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yLevel from platform.common
…string enums - Import SpanStatus from uipath.platform.common._span_utils (StrEnum) - Remove local int-based SpanStatus class and inner Status class - Update _build_url to /api/Traces/v3/spans - Update _determine_status() return type to SpanStatus (string values) - Update upsert_span status_override param type to Optional[SpanStatus] - Update debug log message to reference v3 path - Add 4 new tests verifying v3 URL and string enum status values - Fix VerbosityLevel.OFF assertion from int 6 to string "Off" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…m platform.common Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gration Fix ruff import-sort and formatting in span_utils tests and otel_exporters; add TestV3EndToEnd integration test asserting v3/spans URL and string enum values (Status="Ok", Source="CodedAgents") reach the HTTP layer end-to-end. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…wboat doc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.



Motivation
The UiPath LLM Observability backend is introducing V3 span APIs with insert-only ingestion semantics. The V3 endpoint rejects integer enum values — all status, source, verbosity, and execution type fields must be strings (e.g.
"Ok"not1). This PR migrates the Python SDK's span ingestion pipeline to conform to the V3 contract.Summary
_span_utils.py: ReplaceIntEnum-basedVerbosityLevelwithStrEnum; addSpanStatus,SpanSource,ExecutionTypeasStrEnumtypes with values matching C# server enum names exactly ("Ok","CodedAgents","Information","Runtime"). Add int→StrEnum lookup dicts for bridging raw OTEL attribute integers to enum members. UpdateUiPathSpanfield types fromintto the new enums. Updateotel_span_to_uipath_span()to produce string enum values._otel_exporters.py: Remove the old integerSpanStatusclass and innerStatusclass. ImportSpanStatusfrom_span_utils. Update_build_url()from/api/Traces/spans→/api/Traces/v3/spans. Update_determine_status()return type andupsert_span()parameter type._live_tracking_processor.py: UpdateSpanStatusimport to come from_span_utilsinstead of_otel_exporters. Update_upsert_span_asynctype annotation fromint | NonetoSpanStatus | None.platform/common/__init__.py: ExportExecutionType,SpanSource,SpanStatus(new public types).tracing/__init__.py: Re-exportSpanStatusfrom_span_utilsinstead of_otel_exporters.test_span_utils.pywith StrEnum unit tests and enum value assertions. Updatedtest_otel_exporters.pywith v3 URL assertions, string enum body assertions, and a newTestV3EndToEndintegration test.Test plan
packages/uipath-platform: 1212 passed, 0 failedpackages/uipath: 1866 passed, 0 failedmypy src testsclean on both packages (0 errors)ruff check+ruff format --checkclean on both packagesTestV3EndToEnd.test_export_posts_to_v3_url_with_string_enums— end-to-end: real OTel span →LlmOpsHttpExporter→ asserts POST tov3/spanswith"Status": "Ok"and"Source": "CodedAgents"as strings🤖 Generated with Claude Code