feat(platform): promote verbosityLevel attribute to top-level VerbosityLevel field#1627
Draft
cotovanu-cristian wants to merge 6 commits into
Draft
feat(platform): promote verbosityLevel attribute to top-level VerbosityLevel field#1627cotovanu-cristian wants to merge 6 commits into
cotovanu-cristian wants to merge 6 commits into
Conversation
…tyLevel field Add a `verbosity_level: Optional[int]` field on `UiPathSpan` that surfaces as `"VerbosityLevel"` in `to_dict()`. `_SpanUtils.otel_span_to_uipath_span` now promotes a `verbosityLevel` OTEL span attribute into this top-level field, following the same pattern as `executionType`, `agentVersion`, and `referenceId`. Lets producers tag a span as internal-only (e.g. VerbosityLevel=OFF=6) so LLMOps can filter it from user-facing trace UIs. Bumps uipath-platform 0.1.48 -> 0.1.49. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add `VerbosityLevel` IntEnum (Verbose=0, Trace=1, Information=2, Warning=3, Error=4, Critical=5, Off=6) in `uipath.platform.common._span_utils`, and re-export it via `uipath.tracing` for public consumption — same pattern as `AttachmentDirection`, `AttachmentProvider`, `SpanAttachment`. Values match the C# `UiPath.LLMOps.DataAccess.Models.VerbosityLevelEnum`. Producers can now set `verbosityLevel=VerbosityLevel.OFF` on a span attribute to keep it out of user-facing trace UIs. Bumps uipath 2.10.63 -> 2.10.64, tightens uipath-platform lower bound to 0.1.49 so the new uipath release also pulls the field plumbing in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…n test Replace the tautological `test_values_match_backend_enum` (which just read back source values) and the two verbosity-specific promotion tests with a single table-driven test in `TestVerbosityLevel` that documents which OTEL attributes are promoted to top-level `UiPathSpan` fields. The test serves as both regression guard and documentation: adding a row means the attribute is newly promoted, removing one signals a contract break for downstream consumers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The class checks promotion of all attributes (executionType, agentVersion, referenceId, verbosityLevel), not just verbosity level. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Names the test class after the conversion function it exercises (`_SpanUtils.otel_span_to_uipath_span`). Drops "promotion" terminology in favour of "OTel attribute -> UiPathSpan field mapping". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Backwards compat: pre-existing spans never emitted a VerbosityLevel field on the wire — the LLMOps backend applies its own default (Information=2) for spans that don't carry it. Unconditionally adding `"VerbosityLevel": null` to every span's JSON would change the wire format for every existing span in every existing agent. Make the key conditional in `UiPathSpan.to_dict()`: emit only when the producer explicitly opted in (e.g. AgentDefinition span with VerbosityLevel.OFF). Spans that don't set it produce byte-for-byte identical JSON to pre-change, leaving the backend's default path untouched. Adds `test_verbosity_level_omitted_when_unset` to lock the contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
🚨 Heads up:
|
🚨 Heads up:
|
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.



Summary
verbosity_level: Optional[int]toUiPathSpan, output as"VerbosityLevel"into_dict()._SpanUtils.otel_span_to_uipath_spanpromotes averbosityLevelOTEL span attribute to the new top-level field — same shape as the existingexecutionType/agentVersion/referenceIdpromotions.VerbosityLevel=OFF=6) so LLMOps can filter it out of user-facing trace UIs.uipath-platform0.1.48→0.1.49.Test plan
pytest packages/uipath-platform/tests/services/test_span_utils.py— 20 passed, includes two new tests covering populated and absentverbosityLevel.pytest packages/uipath/tests/tracing/test_otel_exporters.py— 25 passed, no regression on the existing exporter pipeline.verbosityLevel:to_dict()["VerbosityLevel"]isnull(consistent withExecutionType/AgentVersion).🤖 Generated with Claude Code