fix(tracing): exclude a2a-sdk instrumentation scope from LLMOps export#1753
fix(tracing): exclude a2a-sdk instrumentation scope from LLMOps export#1753PopescuTudor wants to merge 1 commit into
Conversation
radu-mocanu
left a comment
There was a problem hiding this comment.
Golden-rule review
The change drops third-party a2a-sdk instrumentation noise at the span-processor layer in uipath-core and uipath. Versions are bumped in both packages and the uipath->uipath-core minimum is raised to 0.5.23, with uv.lock updated. The one golden-rule concern is that this new always-on exclusion behavior is enabled unconditionally rather than gated behind an opt-in feature flag.
1 golden-rule violation(s) found:
- [GR-4]
packages/uipath-core/src/uipath/core/tracing/processors.py:42: New span-exclusion behavior is enabled unconditionally- The new always-on drop of a2a-python-sdk spans runs for every agent (coded and low-code) with no kill switch. New behavior should default OFF behind an env-var feature flag (UIPATH_FEATURE_) on a patch version, then flip the default on later.
- Fix: Gate is_excluded_instrumentation_scope behind an env-var feature flag (default off), or document why this is a safe deterministic noise filter exempt from the flag policy.
Automated review against the repo's golden rules. Reply if a rule is misapplied.
| """Called when a span ends. Filters before delegating to parent.""" | ||
| # Always drop third-party instrumentation noise, then apply the | ||
| # optional span filter. | ||
| if is_excluded_instrumentation_scope(span): |
There was a problem hiding this comment.
[GR-4] New span-exclusion behavior is enabled unconditionally
The new always-on drop of a2a-python-sdk spans runs for every agent (coded and low-code) with no kill switch. New behavior should default OFF behind an env-var feature flag (UIPATH_FEATURE_) on a patch version, then flip the default on later.
Fix: Gate is_excluded_instrumentation_scope behind an env-var feature flag (default off), or document why this is a safe deterministic noise filter exempt from the flag policy.
1e9bec2 to
0419526
Compare
|
Addressed GR-4: the exclusion is now gated behind the |
The a2a-sdk auto-instruments its JSON-RPC transport (instrumentation scope "a2a-python-sdk"), emitting one span per transport method. These surface as noisy, unparented nodes in the execution trace and are not meaningful execution spans. Low-code agents already drop them via the custom_instrumentation span filter, but coded agents run with no span filter (settings=None), so the noise reaches the trace. Drop spans from excluded third-party instrumentation scopes at the span-processor layer, before and independent of the optional UiPathTraceSettings span_filter, so the exclusion applies to every agent (coded and low-code): - uipath-core: add EXCLUDED_INSTRUMENTATION_SCOPES + is_excluded_instrumentation_scope and apply it in UiPathExecutionTraceProcessorMixin.on_end. - uipath: apply it in LiveTrackingSpanProcessor.on_start/on_end. Gated behind the UIPATH_FEATURE_ExcludeThirdPartyTraceScopes feature flag (default off); the default flips on in a later release once validated in the field, per the safe-rollout convention. Bumps uipath-core 0.5.22->0.5.23 and uipath 2.11.12->2.11.13, and raises uipath's minimum on uipath-core to 0.5.23. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELDu3m5eaURJrMVarc8VfY
0419526 to
1072167
Compare
|



Problem
The a2a-sdk auto-instruments its JSON-RPC transport — every method of
JsonRpcTransportis wrapped under the OpenTelemetry instrumentation scopea2a-python-sdk, emitting spans likea2a.client.transports.jsonrpc.JsonRpcTransport.send_message/_get_http_args/_send_request. These render as noisy, unparented internal-method nodes in the execution trace and aren't meaningful execution spans.Low-code agents already drop them, because the agent runtime exports through
FilteringSpanExporter(filter_fn=is_custom_instrumentation_span)— and a2a-sdk spans aren'tuipath.custom_instrumentation. But coded agents run with no span filter (settings=None→span_filter=None), so the a2a-sdk spans pass straight through to the trace.Change
Drop spans from excluded third-party instrumentation scopes at the span-processor layer, before and independent of the optional
UiPathTraceSettings.span_filter, so the exclusion applies to every agent (coded and low-code), ordering-independent and with no global env mutation:EXCLUDED_INSTRUMENTATION_SCOPES = frozenset({"a2a-python-sdk"})andis_excluded_instrumentation_scope(span)incore/tracing/types.py, and apply it inUiPathExecutionTraceProcessorMixin.on_end(batch/simple export path).LiveTrackingSpanProcessor.on_start/on_end(the live-upsert path that feeds the job Execution Trace).The denylist is a single, extensible set, mirroring the existing
is_custom_instrumentation_spanfilter convention.Tests
uipath-core:is_excluded_instrumentation_scopematches a2a-sdk spans and ignores normal spans; a2a-sdk-scope spans are dropped even withspan_filter=None(the coded path).uipath:LiveTrackingSpanProcessor.on_start/on_endskip excluded-scope spans.ruff,ruff format,mypy, and both packages' affected test modules pass locally (9/9 and 34/34).Versioning
Bumps
uipath-core0.5.22→0.5.23 anduipath2.11.12→2.11.13, and raisesuipath's minimum onuipath-coreto>=0.5.23(co-changed internal packages).🤖 Generated with Claude Code
https://claude.ai/code/session_01ELDu3m5eaURJrMVarc8VfY