fix: resolve missing trace spans in embedded AdkWebServer#1183
Open
hemasekhar-p wants to merge 1 commit intogoogle:mainfrom
Open
fix: resolve missing trace spans in embedded AdkWebServer#1183hemasekhar-p wants to merge 1 commit intogoogle:mainfrom
hemasekhar-p wants to merge 1 commit intogoogle:mainfrom
Conversation
9bd907b to
93fa007
Compare
93fa007 to
0f49e96
Compare
Author
|
@krwc Please have a look into it. |
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.
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):
OpenTelemetrySdkis never bridged intocom.google.adk.telemetry.Tracing#1175Problem:
When
AdkWebServeris embedded as a child Spring Context,OpenTelemetryspans generated by the core Tracing utility is dropped, leaving theDev UI'sTrace tab completely empty. This occurs because theDev UIcorrectly skipsGlobalOpenTelemetryregistration to avoid polluting the parent application's telemetry, but the core engine'sTracingutility 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 ingoogle-adkto allow external frameworks to inject a custom tracer.Web: Updated
OpenTelemetryConfigingoogle-adk-devto automatically inject its isolated SDK tracer into the core engine upon bean creation.Testing Plan
Manual End-to-End (E2E) Tests:
Created a Spring Boot application EnterpriseAgentApplication configured as the parent context, launching
AdkWebServeras a child context on port 8080.Disabled external
OpenTelemetryexports in application.properties (management.otlp.tracing.export.enabled=false) to ensure strict isolation.Sent multiple prompts to the compiled agent.
Opened the
Tracetab in the left-hand navigation panel.