Repository navigation
Conversation
DABH
marked this pull request as ready for review
October 29, 2026 00:47
…andom Span identifiers derive from the Run ID so a Reset cannot reuse identifiers the original run exported, GoogleAdkTracing.create accepts the application's Resource, query handlers no longer consume the deterministic sequence, and BackgroundCall propagates context without initializing ADK's global tracer on the Activity path. TemporalAdk.await is flattened, the OpenTelemetry version follows the dependency mode, and the subprocess test is organized around a scenario table with an explicit exit.
The plugin Javadoc states that native spans ended outside a run/await turn are discarded, the flush Javadoc and README name the routing rule precisely, and the subprocess test classifies call_llm spans by the attribute the plugin adds so its removal is caught.
ScriptedModel evaluates its script when the flow is subscribed, like a real model, so the subscription-time context propagation in BackgroundCall is covered by the tracing scenarios. The OpenTelemetry version follows ADK's pin in every dependency mode instead of roaming ahead of ADK's exporters in latest mode.
DABH
force-pushed
the
feat/java-adk-native-tracing
branch
2 times, most recently
from
October 29, 2026 05:19
be33ba3 to
2b8f680
Compare
brianstrauch
left a comment
Member
There was a problem hiding this comment.
Validated with spotlessCheck test stageDist (106 tests passed). The inline finding is reproduced against this commit.
Timer and Activity completion callbacks enter through the inbound interceptor's newCallbackThread, which the plugin did not wrap, so a turn started from such a callback had no tracing context and its native spans went to the application provider without replay suppression. The callback runnable now runs with the Worker's tracing instance selected, like the workflow method, Signal, and Update entry points. A new CALLBACK scenario starts the turn inside a timer callback, and every opted-in scenario now asserts that no native span reaches the application provider.
brianstrauch
left a comment
Member
There was a problem hiding this comment.
Validated ed48690 with ./gradlew spotlessCheck test stageDist: all 120 tests passed. Both inline findings were reproduced with focused variants of the isolated-JVM tracing tests.
Promises the SDK completes (timers, Activities, child Workflows, Nexus operations, external Signals, cancellations) now run their callbacks in the trace context that registered them, so a turn started from a completion callback keeps its enclosing span and turn buffer instead of starting a second trace and exporting before the outer turn finishes. Update validators run with the tracing instance deselected, because the SDK skips them on replay and a native span there would advance the deterministic identifier sequence and change the IDs a resumed turn already propagated to its Activities. Two scenarios cover a nested turn inside a timer callback and a validator span across an eviction.
Member
|
Waiting on temporalio/sdk-java#3089 |
This branch has not been deployed
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.
With an OpenTelemetry SDK installed, ADK's native
invoke_agent,call_llm, andexecute_toolspans created in Workflow code are exported again on every replay. This addsGoogleAdkTracingand the opt-inGoogleAdkPlugin.Builder.tracing(...).GoogleAdkTracing.wrap(...)wraps the application's OpenTelemetry before its global registration. Native ADK spans on Workflow threads route to the tracing instance of the Worker's plugin; everything else reaches the application's provider unchanged. Workflow spans use Workflow time and deterministic span IDs seeded by the Run ID, stay buffered until the outerTemporalAdk.run/awaitturn ends, and export once through a dedicated batch exporter that carries the application'sResource. Replay rebuilds unfinished turns and suppresses completed ones; eviction discards unfinished buffers; query handlers never consume the ID sequence. W3C trace context propagates through model and tool Activities, Workflow callbacks, child threads, and provider RxJava threads without initializing ADK's tracer on the Activity path. Export is asynchronous and not transactional with Workflow Task completion, so a crash or task retry between export and commit can repeat spans with the same IDs.The README documents bootstrap order, exporter ownership, and flushing. Thirteen isolated-JVM scenarios cover attributes and parentage, tracestate, eviction, unfinished and legacy replay, nested, parallel, and overlapping turns, Signals and Updates, retries, failure, cancellation, multiple exporters, and opt-out, without provider credentials. Worker restart was verified against a local Temporal service.
Fixes #258.