Describe the bug
In ADK-Java, when using Flowable for asynchronous execution in runner.java and BaseAgent.java, the OpenTelemetry trace context is not properly propagated. As a result, the trace tree in the OpenTelemetry backend does not show the expected parent-child span relationships. This breaks the trace continuity and makes debugging and performance analysis difficult.
To Reproduce
Steps to reproduce the behavior:
- Clone the ADK-Java repository and set up a sample agent.
- Start the AdkWebServer.
- Observe the trace output in AdkWeb UI.
- Notice that spans created inside flatMap do not appear as children of the initial span.
Expected behavior
Spans created inside the Flowable chain (e.g., in BaseAgent.runAsync) should maintain the parent-child relationship with the span created in runner.runAsync. The trace tree should reflect the full execution flow, preserving context across asynchronous boundaries.
Screenshots
the trace tree showing disconnected spans.

Desktop (please complete the following information):
- OS: ubuntu-24
- Java 17
- adk-java v0.2.0
Additional context
This issue appears to be related to RxJava's handling of thread-local context. OpenTelemetry context is not automatically propagated across asynchronous boundaries in RxJava unless explicitly wrapped.
Describe the bug
In ADK-Java, when using Flowable for asynchronous execution in runner.java and BaseAgent.java, the OpenTelemetry trace context is not properly propagated. As a result, the trace tree in the OpenTelemetry backend does not show the expected parent-child span relationships. This breaks the trace continuity and makes debugging and performance analysis difficult.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Spans created inside the Flowable chain (e.g., in BaseAgent.runAsync) should maintain the parent-child relationship with the span created in runner.runAsync. The trace tree should reflect the full execution flow, preserving context across asynchronous boundaries.
Screenshots

the trace tree showing disconnected spans.
Desktop (please complete the following information):
Additional context
This issue appears to be related to RxJava's handling of thread-local context. OpenTelemetry context is not automatically propagated across asynchronous boundaries in RxJava unless explicitly wrapped.