Skip to content

WIP: not yet ready for review (deprecate agent scope continuation)#11910

Draft
mcculls wants to merge 23 commits into
masterfrom
mcculls/deprecate-agent-scope-continuation
Draft

WIP: not yet ready for review (deprecate agent scope continuation)#11910
mcculls wants to merge 23 commits into
masterfrom
mcculls/deprecate-agent-scope-continuation

Conversation

@mcculls

@mcculls mcculls commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

*** WIP: not yet ready for review ***

What Does This Do

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

mcculls and others added 14 commits July 10, 2026 16:44
…ntinuation

AgentScope.Continuation was a bridging interface that extended both
TraceScope.Continuation (public API) and ContextContinuation (modern
context API). It is now @deprecated — internal call sites migrate to
ContextContinuation directly.

Key changes:
- AgentScope.Continuation marked @deprecated
- AgentTraceCollector.register/removeContinuation now accept ContextContinuation
- AgentTracer.captureActiveSpan()/captureSpan() static methods return ContextContinuation
  (implementations still return AgentScope.Continuation for Tracer interface compat)
- ScopeContinuation gains resume()/release() for the ContextContinuation contract
- State, ConcurrentState, Wrapper, VirtualThreadState, AdviceUtils, TPEHelper
  all migrated from AgentScope.Continuation to ContextContinuation/ContextScope
- ~85 instrumentation files updated: field types use ContextContinuation,
  activate()→resume(), cancel()→release(), scope types use ContextScope

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n from captureSpan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The deprecated captureActiveSpan() becomes a default method wrapping
captureActiveContext(), using contextScope::close to satisfy TraceScope SAM.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ture(Context) edge cases

Route deprecated captureActiveSpan() through Context.current().capture() directly,
removing the captureActiveContext() method from TracerAPI, CoreTracer, NoopTracerAPI,
and ContinuableScopeManager. Also fix capture(Context) to return noop for root context
and reorder/comment the async propagation condition for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The erroneous pattern introduced in b99070a activated the continuation,
then immediately merged it back into the current context (which was already
the continuation's context after resume), before closing the activated scope.
The correct approach is simply continuation.resume().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Redisson listeners

- @advice classes use spanFromContext (Java8BytecodeBridge) consistently
- Non-advice helpers keep AgentSpan.fromContext directly
- Redisson SpanFinishListener (x3): extract span from continuation.context()
  before resume() to avoid the redundant round-trip through scope.context()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… == Context.root()

NoopContinuation.context() now returns Context.root() rather than the noop span,
making context() == Context.root() a semantic and implementation-agnostic way to
test whether a continuation carries meaningful context. This decouples call sites
from ContinuableScopeManager's specific noop singleton, easing future migration
away from that implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… ContextContinuation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Widen capture() return type from AgentScope.Continuation to TraceScope.Continuation,
eliminating the only reference to the deprecated type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement ContextContinuation and TraceScope.Continuation directly,
removing the deprecated bridge interface, @SuppressWarnings, and the
span() method that was only required by AgentScope.Continuation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ScopeContinuation now implements ContextContinuation + TraceScope.Continuation directly
- CoreTracer.captureActiveSpan() overrides the TracerAPI default, delegating to
  ContinuableScopeManager.capture(Context.current()) which handles async propagation
- Test code updated: ContextContinuation cast where needed, activate() -> resume(),
  cancel() -> release()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Narrow cast in activate() from (AgentScope) to (TraceScope) to match
  the declared return type; remove now-unused AgentScope import
- Extract private captureActiveSpan() helper in ScopeManagerTest to
  eliminate 14 repeated (ContextContinuation) cast sites

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ers; fix typo

Redisson SpanFinishListener was pre-extracting the span before resume() but
using scope for decorator calls — move extraction inside the try block using
scope.context() for a consistent pattern. Fix Javadoc typo in PromiseHelper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mcculls mcculls added tag: do not merge Do not merge changes comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring labels Jul 10, 2026
@mcculls mcculls requested a review from Copilot July 10, 2026 15:58
@mcculls

mcculls commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad migration away from AgentScope.Continuation/TraceScope.Continuation-centric async propagation toward the newer datadog.context APIs (ContextContinuation, ContextScope) across the agent bootstrap layer, core tracer, and many instrumentations, while deprecating legacy entry points.

Changes:

  • Deprecates legacy continuation capture APIs and shifts captureActiveSpan()/captureSpan() call sites to ContextContinuation + resume()/release().
  • Updates core scope/continuation plumbing (ScopeContinuation, collectors, tracer entry points) to operate on ContextContinuation.
  • Refactors many instrumentations and tests to use ContextScope activation and Context.root()-based “noop” detection.

Reviewed changes

Copilot reviewed 103 out of 103 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopScope.java Adjusts noop scope capture to return TraceScope.Continuation backed by NoopContinuation.
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopContinuation.java Reworks noop continuation to implement ContextContinuation + TraceScope.Continuation.
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/java/lang/ProcessImplInstrumentationHelpers.java Migrates process completion propagation from AgentScope.Continuation to ContextContinuation.
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java Deprecates legacy capture APIs and shifts public helpers to ContextContinuation/Context.current().
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java Updates collector interface to accept ContextContinuation.
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentScope.java Deprecates AgentScope.Continuation while bridging it to ContextContinuation.
dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerTest.java Updates tests to use ContextContinuation + resume()/release().
dd-trace-core/src/test/java/datadog/trace/core/PendingTraceStrictWriteTest.java Migrates pending-trace tests from cancel() to release().
dd-trace-core/src/test/java/datadog/trace/core/PendingTraceBufferTest.java Updates buffering tests to use ContextContinuation storage and release().
dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java Updates trace collector continuation hooks to ContextContinuation.
dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java Refactors continuation implementation to ContextContinuation + adds resume()/release() behavior.
dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java Removes legacy captureActiveSpan() and routes capture through Context capture logic.
dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java Updates pending trace collector hooks to ContextContinuation.
dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java Routes capture to Context.current()/ContextContinuation and updates method signatures.
dd-java-agent/instrumentation/zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0/FiberContext.java Migrates fiber context continuation release to ContextContinuation.release().
dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryResultHandlerWrapper.java Uses ContextContinuation and ContextScope for handler resumption.
dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryAdvice.java Captures parent context with ContextContinuation.
dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/CursorReadAdvice.java Captures parent context with ContextContinuation.
dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandlerWrapper.java Switches response wrapper to ContextContinuation + resume().
dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandler.java Switches response handler to ContextContinuation + ContextScope.
dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisSendAdvice.java Uses ContextContinuation for parent propagation.
dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisFutureSendAdvice.java Updates advice locals to ContextContinuation.
dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPICallAdvice.java Captures parent via ContextContinuation.
dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowDecorator.java Stores undertow continuation as ContextContinuation attachment.
dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowBlockingHandler.java Derives span from continuation.context() for blocking bookkeeping.
dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java Reads span via spanFromContext(continuation.context()).
dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/UndertowRunnableWrapper.java Wraps runnables with ContextContinuation and resume().
dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java Reads span via spanFromContext(continuation.context()).
dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java Reads span via spanFromContext(continuation.context()).
dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HandlerInstrumentation.java Uses ContextContinuation.context() + spanFromContext for attach/activation paths.
dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ExchangeEndSpanListener.java Updates end-of-exchange release to ContextContinuation.release().
dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerWorkerInstrumentation.java Propagates via ContextContinuation and resume().
dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientWorkerInstrumentation.java Propagates via ContextContinuation and resume().
dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpannedMethodInvocation.java Uses ContextContinuation and Context.root() to gate resumption.
dd-java-agent/instrumentation/spring/spring-rabbit-1.5/src/main/java/datadog/trace/instrumentation/springamqp/AbstractMessageListenerContainerInstrumentation.java Resumes parent context via ContextContinuation.resume().
dd-java-agent/instrumentation/slick-3.2/src/main/java/datadog/trace/instrumentation/slick/SlickRunnableInstrumentation.java Switches task scope activation from AgentScope to ContextScope.
dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/src/test/groovy/ContextPreservingInstrumentationTest.groovy Updates tests to capture/release via ContextContinuation.
dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/test/groovy/ContextPreservingInstrumentationTest.groovy Updates tests to capture/release via ContextContinuation.
dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/src/main/java/datadog/trace/instrumentation/scala/PromiseHelper.java Migrates continuation handling to ContextContinuation + release().
dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/src/main/java/datadog/trace/instrumentation/scala213/concurrent/PromiseTransformationInstrumentation.java Changes advice scope type to ContextScope.
dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/CallbackRunnableInstrumentation.java Changes advice scope type to ContextScope.
dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/main/java/datadog/trace/instrumentation/scala/concurrent/ScalaForkJoinTaskInstrumentation.java Changes advice scope type to ContextScope.
dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/main/java/datadog/trace/instrumentation/redisson30/SpanFinishListener.java Resumes context with ContextContinuation and finishes span derived from scope context.
dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/main/java/datadog/trace/instrumentation/redisson23/SpanFinishListener.java Same migration for older redisson version.
dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/main/java/datadog/trace/instrumentation/redisson/SpanFinishListener.java Same migration for older redisson version.
dd-java-agent/instrumentation/reactor-netty-1.0/src/main/java/datadog/trace/instrumentation/reactor/netty/TransferConnectSpan.java Uses ContextContinuation and release() for connect span propagation.
dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/AsyncHandlerWrapper.java Uses ContextContinuation and resume() around delegate callbacks.
dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/AsyncHandlerWrapper.java Same migration for older play-ws version.
dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/AsyncHandlerWrapper.java Same migration for older play-ws version.
dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoRoutedActorCellInstrumentation.java Updates task scope activation to ContextScope.
dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoForkJoinExecutorTaskInstrumentation.java Updates task scope activation to ContextScope.
dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java Uses ContextScope local for task scope lifecycle.
dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ThreadedActionListenerInstrumentation.java Updates task scope activation to ContextScope.
dd-java-agent/instrumentation/netty/netty-promise-4.0/src/main/java/datadog/trace/instrumentation/netty4/promise/ListenerWrapper.java Stores ContextContinuation, uses resume(), and derives span from continuation.context().
dd-java-agent/instrumentation/netty/netty-common/src/main/java/datadog/trace/instrumentation/netty41/AttributeKeys.java Changes connect continuation attribute type to ContextContinuation.
dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelPipelineInstrumentation.java Captures/sets connect continuation via ContextContinuation + release() on conflict.
dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/Http2ConnectContinuationListener.java Cancels connect continuation via release().
dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java Resumes parent context from connect continuation via resume().
dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java Resumes parent context for connect errors via resume().
dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelPipelineInstrumentation.java Same connect continuation migration for netty 4.0.
dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientRequestTracingHandler.java Same resume() migration for netty 4.0 client handler.
dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java Same connect-error resumption migration for netty 4.0.
dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/AttributeKeys.java Changes connect continuation attribute type to ContextContinuation.
dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/NettyChannelInstrumentation.java Captures connect continuation via ContextContinuation + release() on conflict.
dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientRequestTracingHandler.java Resumes connect continuation via resume().
dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelTraceContext.java Stores connect continuation as ContextContinuation.
dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java Resumes connect continuation for connect errors via resume().
dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/src/main/java/datadog/trace/instrumentation/mongo/CallbackWrapper.java Uses ContextContinuation for Mongo callback resumption and release() on cancel.
dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/CommandHandlerInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/AsyncCommandInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java Uses ContextContinuation and release() when coroutine completes.
dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyRunnableWrapper.java Wraps runnables with ContextContinuation and resume().
dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/CompletableFutureWrapper.java Uses ContextContinuation and resume() for CF completion callbacks.
dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/BodyHandlerWrapper.java Uses ContextContinuation and resume() for body subscriber callbacks.
dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java Updates docs/types to reference ContextContinuation in virtual-thread lifecycle.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/src/main/java/datadog/trace/instrumentation/java/concurrent/virtualthread/TaskRunnerInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/java/util/concurrent/CompletableFutureAdvice.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableFutureInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/ConsumerTaskInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinTaskInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/ThreadPoolExecutorInstrumentation.java Updates advice scope type to ContextScope and thread-local handling.
dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/completablefuture/AsyncTaskInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/QueuedCommandInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ThreadedActionListenerInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisEngineInstrumentation.java Resumes parent via ContextContinuation.resume() when continuing message spans.
dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/TraceContinuedFutureCallback.java Uses ContextContinuation + resume() and Context.root() noop check.
dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/ApacheHttpAsyncClientInstrumentation.java Captures parent continuation as ContextContinuation.
dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/src/main/java/datadog/trace/instrumentation/apachehttpasyncclient/TraceContinuedFutureCallback.java Uses ContextContinuation + resume() and Context.root() noop check.
dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/src/main/java/datadog/trace/instrumentation/apachehttpasyncclient/ApacheHttpAsyncClientInstrumentation.java Captures parent continuation as ContextContinuation.
dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaRoutedActorCellInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinTaskInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinExecutorTaskInstrumentation.java Updates advice scope type to ContextScope.
dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java Uses ContextScope local for task scope lifecycle.
dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/TracingListener.java Switches listener propagation to ContextContinuation + resume()/release().
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java Stores ContextContinuation and calls release() at virtual-thread termination.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/Wrapper.java Updates wrapper continuation to ContextContinuation and uses resume()/release().
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/TPEHelper.java Switches thread-local tracking to ContextScope.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/State.java Stores ContextContinuation and updates close/release semantics.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ContinuationClaim.java Updates claim sentinel to implement ContextContinuation.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java Migrates concurrent state continuation to ContextContinuation + ContextScope.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ComparableRunnable.java Updates wrapper constructor to accept ContextContinuation.
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/AdviceUtils.java Switches task-scope helpers to ContextScope/ContextContinuation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 4.00%
Overall Coverage: 56.56% (-0.49%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 67641ab | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b808b50f47

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dd-octo-sts

dd-octo-sts Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.96 s 13.91 s [-0.3%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.95 s 12.95 s [-0.8%; +0.7%] (no difference)
startup:petclinic:appsec:Agent 16.82 s 16.87 s [-1.3%; +0.7%] (no difference)
startup:petclinic:iast:Agent 16.86 s 16.41 s [-1.7%; +7.2%] (no difference)
startup:petclinic:profiling:Agent 16.63 s 16.89 s [-3.0%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 16.23 s 16.79 s [-7.6%; +0.9%] (no difference)
startup:petclinic:tracing:Agent 15.90 s 16.02 s [-1.8%; +0.3%] (no difference)

Commit: 67641ab6 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

mcculls and others added 5 commits July 10, 2026 20:47
…face calls

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xception

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mcculls mcculls requested a review from Copilot July 10, 2026 23:21
@mcculls

mcculls commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 105 out of 105 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (3)

dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java:74

  • spanFromContext(continuation.context()) may be null if the stored continuation has a root/no-op context; undertowSpan is dereferenced unconditionally. Add a null check to avoid NPEs in dispatch.
    dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java:66
  • spanFromContext(continuation.context()) may be null if the stored continuation has a root/no-op context; undertowSpan is dereferenced unconditionally. Add a null check to avoid NPEs in dispatch.
    dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java:79
  • spanFromContext(continuation.context()) can be null if the continuation context does not carry SPAN_KEY. The current code uses span and span.getRequestContext() unconditionally, which can throw NPE; bail out if span is null.

… change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4e1ee7035

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

mcculls and others added 3 commits July 11, 2026 00:47
…without consuming the continuation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es correctly in tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: do not merge Do not merge changes tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants