feat(datafabric): add OTEL span instrumentation for SQL query execution#964
Closed
UIPath-Harshit wants to merge 1 commit into
Closed
feat(datafabric): add OTEL span instrumentation for SQL query execution#964UIPath-Harshit wants to merge 1 commit into
UIPath-Harshit wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds OpenTelemetry span instrumentation around Data Fabric SQL execution to make query successes/failures observable (including structured error classification), and expands the Data Fabric subgraph state to surface the last error category/detail in termination messaging.
Changes:
- Instrument
QueryExecutor.__call__with a dedicated OTEL span and structured attributes for success/error cases (with optionalDataFabricErrorenrichment). - Track and propagate the last tool error category/detail through the subgraph state and termination message.
- Add a comprehensive test suite for the Data Fabric subgraph behavior (routing/tool execution/OTEL paths) and relax the
uipathdependency upper bound.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/agent/tools/test_datafabric_subgraph.py | Adds tests covering QueryExecutor telemetry/error formatting and subgraph routing/tool/termination behavior. |
| src/uipath_langchain/agent/tools/datafabric_tool/datafabric_subgraph.py | Adds OTEL span instrumentation for DF SQL execution; enriches error handling and propagates last error metadata through the graph. |
| pyproject.toml | Relaxes the uipath dependency upper bound to allow newer versions. |
…ion for SQL queries - Add OpenTelemetry span around Data Fabric SQL query execution with entity metadata, success/error attributes, and structured error codes - Integrate DataFabricError classification from uipath-platform for richer error diagnostics (category, code, trace_id) on spans - Propagate error category and detail to parent graph state for termination messaging - Bump uipath upper bound to <2.13.0 and uipath-platform to 0.1.90 - Add comprehensive unit tests for datafabric_subgraph (98% coverage) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b53da63 to
7a1ba13
Compare
|
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
QueryExecutor.__call__in a dedicated OTEL span ("Data Fabric SQL query") with structured attributes:df.sql_query— the executed SQLdf.success,df.record_count— on successdf.error.code,df.error.category,df.error.message,df.error.trace_id— on error (parsed from DF server response viaDataFabricError)df.entity_count,df.native_entity_count,df.federated_entity_count,df.native_entities,df.federated_entities— entity type classification based onexternal_fieldspresenceDataFabricErroris not available (olderuipath-platformwithout the companion PR)Motivation: DF query errors (400s and 500s) were previously swallowed by
QueryExecutorwith no span attributes — invisible in App Insights. This adds the telemetry needed to diagnose SQL generation failures and track native vs federated usage.Companion PR: UiPath/uipath-python — adds
DataFabricErrorclassification consumed here.Test plan
DataFabricErrorinuipath-platformexternal_fieldsuv run pytest -k "datafabric")🤖 Generated with Claude Code