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/src/main/java/datadog/trace/instrumentation/playws2
play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21
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
6 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1
1
package datadog .trace .instrumentation .playws1 ;
2
2
3
- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3
+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
4
4
import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
5
5
import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
6
6
@@ -22,7 +22,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
22
22
public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
23
23
this .delegate = delegate ;
24
24
this .span = span ;
25
- continuation = capture ( );
25
+ continuation = captureSpan ( span );
26
26
}
27
27
28
28
@ Override
Original file line number Diff line number Diff line change 1
1
package datadog .trace .instrumentation .playws21 ;
2
2
3
- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3
+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
4
4
import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
5
5
import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
6
6
@@ -27,7 +27,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
27
27
public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
28
28
this .delegate = delegate ;
29
29
this .span = span ;
30
- continuation = capture ( );
30
+ continuation = captureSpan ( span );
31
31
}
32
32
33
33
@ Override
Original file line number Diff line number Diff line change 1
1
package datadog .trace .instrumentation .playws2 ;
2
2
3
- import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .capture ;
3
+ import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .captureSpan ;
4
4
import static datadog .trace .bootstrap .instrumentation .api .AgentTracer .setAsyncPropagationEnabled ;
5
5
import static datadog .trace .instrumentation .playws .PlayWSClientDecorator .DECORATE ;
6
6
@@ -26,7 +26,7 @@ public class AsyncHandlerWrapper implements AsyncHandler {
26
26
public AsyncHandlerWrapper (final AsyncHandler delegate , final AgentSpan span ) {
27
27
this .delegate = delegate ;
28
28
this .span = span ;
29
- continuation = capture ( );
29
+ continuation = captureSpan ( span );
30
30
}
31
31
32
32
@ Override
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class ContextPreservingInstrumentationTest extends AgentTestRunner {
113
113
*/
114
114
private class ParentContext {
115
115
final ContextMap contextMap = AsyncContext . context(). copy()
116
- final AgentScope.Continuation spanContinuation = AgentTracer . capture( )
116
+ final AgentScope.Continuation spanContinuation = AgentTracer . captureSpan( AgentTracer . activeSpan() )
117
117
118
118
def releaseParentSpan () {
119
119
spanContinuation. cancel()
Original file line number Diff line number Diff line change 1
1
package datadog .trace .instrumentation .zio .v2_0 ;
2
2
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 ;
4
5
5
6
import datadog .trace .bootstrap .instrumentation .api .AgentScope ;
7
+ import datadog .trace .bootstrap .instrumentation .api .AgentSpan ;
6
8
import datadog .trace .bootstrap .instrumentation .api .AgentTracer ;
7
9
import datadog .trace .bootstrap .instrumentation .api .ScopeState ;
8
10
@@ -16,7 +18,8 @@ private FiberContext(ScopeState state) {
16
18
this .state = state ;
17
19
this .scope = null ;
18
20
this .oldState = null ;
19
- this .continuation = capture ();
21
+ AgentSpan span = activeSpan ();
22
+ this .continuation = null != span ? captureSpan (span ) : null ;
20
23
}
21
24
22
25
public static FiberContext create () {
Original file line number Diff line number Diff line change @@ -131,11 +131,6 @@ public static AgentScope activeScope() {
131
131
return get ().activeScope ();
132
132
}
133
133
134
- public static AgentScope .Continuation capture () {
135
- final AgentScope activeScope = activeScope ();
136
- return activeScope == null ? null : activeScope .capture ();
137
- }
138
-
139
134
/**
140
135
* Checks whether asynchronous propagation is enabled, meaning this context will propagate across
141
136
* asynchronous boundaries.
You can’t perform that action at this time.
0 commit comments