File tree Expand file tree Collapse file tree 6 files changed +12
-14
lines changed
dd-java-agent/instrumentation
play-ws-1/src/main/java/datadog/trace/instrumentation/playws1
play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21
play-ws-2/src/main/java/datadog/trace/instrumentation/playws2
servicetalk/src/test/groovy
zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0
internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api Expand file tree Collapse file tree 6 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11package datadog .trace .instrumentation .playws1 ;
22
3- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
44import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
55import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
66
@@ -22,7 +22,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
2222 public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
2323 this .delegate = delegate ;
2424 this .span = span ;
25- continuation = capture ( );
25+ continuation = captureSpan ( span );
2626 }
2727
2828 @ Override
Original file line number Diff line number Diff line change 11package datadog .trace .instrumentation .playws21 ;
22
3- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
44import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
55import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
66
@@ -27,7 +27,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
2727 public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
2828 this .delegate = delegate ;
2929 this .span = span ;
30- continuation = capture ( );
30+ continuation = captureSpan ( span );
3131 }
3232
3333 @ Override
Original file line number Diff line number Diff line change 11package datadog .trace .instrumentation .playws2 ;
22
3- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
44import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
55import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
66
@@ -26,7 +26,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
2626 public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
2727 this .delegate = delegate ;
2828 this .span = span ;
29- continuation = capture ( );
29+ continuation = captureSpan ( span );
3030 }
3131
3232 @ Override
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class ContextPreservingInstrumentationTest extends AgentTestRunner {
113113 */
114114 private class ParentContext {
115115 final ContextMap contextMap = AsyncContext . context(). copy()
116- final AgentScope.Continuation spanContinuation = AgentTracer . capture( )
116+ final AgentScope.Continuation spanContinuation = AgentTracer . captureSpan( AgentTracer . activeSpan() )
117117
118118 def releaseParentSpan () {
119119 spanContinuation. cancel()
Original file line number Diff line number Diff line change 11package datadog .trace .instrumentation .zio .v2_0 ;
22
3- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .activeSpan ;
4+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
45
56import datadog .trace .bootstrap .instrumentation .api .AgentScope ;
7+ import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
68import datadog .trace .bootstrap .instrumentation .api .AgentTracer ;
79import datadog .trace .bootstrap .instrumentation .api .ScopeState ;
810
@@ -16,7 +18,8 @@ private FiberContext(ScopeState state) {
1618 this .state = state ;
1719 this .scope = null ;
1820 this .oldState = null ;
19- this .continuation = capture ();
21+ AgentSpan span = activeSpan ();
22+ this .continuation = null != span ? captureSpan (span ) : null ;
2023 }
2124
2225 public static FiberContext create () {
Original file line number Diff line number Diff line change @@ -131,11 +131,6 @@ public static AgentScope activeScope() {
131131 return get ().activeScope ();
132132 }
133133
134- public static AgentScope .Continuation capture () {
135- final AgentScope activeScope = activeScope ();
136- return activeScope == null ? null : activeScope .capture ();
137- }
138-
139134 /**
140135 * Checks whether asynchronous propagation is enabled, meaning this context will propagate across
141136 * asynchronous boundaries.
You can’t perform that action at this time.
0 commit comments