Skip to content

fix: resolve missing trace spans in embedded AdkWebServer#1183

Open
hemasekhar-p wants to merge 1 commit intogoogle:mainfrom
hemasekhar-p:adk-ui-trace-fix
Open

fix: resolve missing trace spans in embedded AdkWebServer#1183
hemasekhar-p wants to merge 1 commit intogoogle:mainfrom
hemasekhar-p:adk-ui-trace-fix

Conversation

@hemasekhar-p
Copy link
Copy Markdown

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:
When AdkWebServer is embedded as a child Spring Context, OpenTelemetry spans generated by the core Tracing utility is dropped, leaving the Dev UI's Trace tab completely empty. This occurs because the Dev UI correctly skips GlobalOpenTelemetry registration to avoid polluting the parent application's telemetry, but the core engine's Tracing utility is hardcoded to only pull from the global registry, resulting in a fallback No-Op tracer.

Solution:
Core: Added a thread-safe Tracing.setTracer() method in google-adk to allow external frameworks to inject a custom tracer.
Web: Updated OpenTelemetryConfig in google-adk-dev to automatically inject its isolated SDK tracer into the core engine upon bean creation.

Testing Plan

Manual End-to-End (E2E) Tests:

  1. Created a Spring Boot application EnterpriseAgentApplication configured as the parent context, launching AdkWebServer as a child context on port 8080.

  2. Disabled external OpenTelemetry exports in application.properties (management.otlp.tracing.export.enabled=false) to ensure strict isolation.

  3. Sent multiple prompts to the compiled agent.

  4. Opened the Trace tab in the left-hand navigation panel.

@hemasekhar-p hemasekhar-p self-assigned this May 5, 2026
@hemasekhar-p
Copy link
Copy Markdown
Author

@krwc Please have a look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web UI "Trace" tab is empty because Dev UI's OpenTelemetrySdk is never bridged into com.google.adk.telemetry.Tracing

1 participant