Skip to content

Commit ab73c44

Browse files
authored
Simplify activateSpan calls which use the default value for isAsyncPropagating (#8543)
1 parent de80454 commit ab73c44

File tree

75 files changed

+90
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+90
-90
lines changed

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public TestImpl(
116116

117117
span = spanBuilder.start();
118118

119-
activateSpan(span, true);
119+
activateSpan(span);
120120

121121
span.setSpanType(InternalSpanTypes.TEST);
122122
span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_TEST);

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestSuiteImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public TestSuiteImpl(
130130
testDecorator.afterStart(span);
131131

132132
if (!parallelized) {
133-
activateSpan(span, true);
133+
activateSpan(span);
134134
}
135135

136136
metricCollector.add(CiVisibilityCountMetric.EVENT_CREATED, 1, instrumentation, EventType.SUITE);

dd-java-agent/instrumentation/akka-concurrent/src/test/java/LinearTask.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected Integer compute() {
3232
} else {
3333
int next = parent + 1;
3434
AgentSpan span = startSpan(Integer.toString(next));
35-
try (AgentScope scope = activateSpan(span, true)) {
35+
try (AgentScope scope = activateSpan(span)) {
3636
LinearTask child = new LinearTask(next, depth);
3737
return child.fork().join();
3838
} finally {

dd-java-agent/instrumentation/akka-http/akka-http-10.0/src/main/java/datadog/trace/instrumentation/akkahttp/DatadogWrapperHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static AgentScope createSpan(final HttpRequest request) {
1616
DECORATE.afterStart(span);
1717
DECORATE.onRequest(span, request, request, extractedContext);
1818

19-
return activateSpan(span, true);
19+
return activateSpan(span);
2020
}
2121

2222
public static void finishSpan(final AgentSpan span, final HttpResponse response) {

dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static AgentScope nameSpan(
7676
DECORATE.afterStart(span);
7777
span.setResourceName(DECORATE.className(clazz));
7878

79-
return activateSpan(span, true);
79+
return activateSpan(span);
8080
}
8181

8282
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

dd-java-agent/instrumentation/grizzly-2/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static class HandleAdvice {
7878
DECORATE.afterStart(span);
7979
DECORATE.onRequest(span, request, request, parentContext);
8080

81-
scope = activateSpan(span, true);
81+
scope = activateSpan(span);
8282

8383
request.setAttribute(DD_SPAN_ATTRIBUTE, span);
8484
request.setAttribute(CorrelationIdentifier.getTraceIdKey(), GlobalTracer.get().getTraceId());

dd-java-agent/instrumentation/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/FilterAdvice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static AgentScope onEnter(@Advice.Argument(0) final FilterChainContext ct
1717
if (span == null || activeSpan() != null) {
1818
return null;
1919
}
20-
return activateSpan((AgentSpan) span, true);
20+
return activateSpan((AgentSpan) span);
2121
}
2222

2323
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

dd-java-agent/instrumentation/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static NextAction onHttpCodecFilterExit(
116116
HttpResponsePacket httpResponse = httpRequest.getResponse();
117117
AgentSpanContext.Extracted context = DECORATE.extract(httpRequest);
118118
AgentSpan span = DECORATE.startSpan(httpRequest, context);
119-
AgentScope scope = activateSpan(span, true);
119+
AgentScope scope = activateSpan(span);
120120
DECORATE.afterStart(span);
121121
ctx.getAttributes().setAttribute(DD_SPAN_ATTRIBUTE, span);
122122
ctx.getAttributes().setAttribute(DD_RESPONSE_ATTRIBUTE, httpResponse);

dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheAsyncInstrumentation.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static AgentScope onEnter(
9393

9494
// Enable async propagation, so the newly spawned task will be associated back with this
9595
// original trace.
96-
return activateSpan(span, true);
96+
return activateSpan(span);
9797
}
9898

9999
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
@@ -149,7 +149,7 @@ public static AgentScope onEnter(
149149

150150
// Enable async propagation, so the newly spawned task will be associated back with this
151151
// original trace.
152-
return activateSpan(span, true);
152+
return activateSpan(span);
153153
}
154154

155155
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

dd-java-agent/instrumentation/jakarta-rs-annotations-3/src/main/java/datadog/trace/instrumentation/jakarta3/DefaultRequestContextInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static AgentScope createGenericSpan(@Advice.This final ContainerRequestCo
4747
// can only be aborted inside the filter method
4848
}
4949

50-
final AgentScope scope = activateSpan(span, true);
50+
final AgentScope scope = activateSpan(span);
5151

5252
DECORATE.afterStart(span);
5353
DECORATE.onJakartaRsSpan(span, parent, filterClass, method);

dd-java-agent/instrumentation/jakarta-rs-annotations-3/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAnnotationsInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static AgentScope nameSpan(
123123
DECORATE.onJakartaRsSpan(span, parent, target.getClass(), method);
124124
DECORATE.afterStart(span);
125125

126-
final AgentScope scope = activateSpan(span, true);
126+
final AgentScope scope = activateSpan(span);
127127

128128
if (contextStore != null && asyncResponse != null) {
129129
contextStore.put(asyncResponse, span);

dd-java-agent/instrumentation/jakarta-rs-annotations-3/src/main/java/datadog/trace/instrumentation/jakarta3/RequestFilterHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static AgentScope createOrUpdateAbortSpan(
2828
parent = activeSpan();
2929
span = startSpan(JAKARTA_RS_REQUEST_ABORT);
3030

31-
final AgentScope scope = activateSpan(span, true);
31+
final AgentScope scope = activateSpan(span);
3232

3333
DECORATE.afterStart(span);
3434
DECORATE.onJakartaRsSpan(span, parent, resourceClass, method);

dd-java-agent/instrumentation/java-concurrent/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void run() {
2626
return;
2727
}
2828
AgentSpan span = startSpan(String.valueOf(depth));
29-
try (AgentScope scope = activateSpan(span, true)) {
29+
try (AgentScope scope = activateSpan(span)) {
3030
executor.execute(new RecursiveThreadPoolExecution(executor, maxDepth, depth + 1));
3131
} finally {
3232
span.finish();

dd-java-agent/instrumentation/java-concurrent/src/test/java/executor/recursive/RecursiveThreadPoolMixedSubmissionAndExecution.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public void run() {
2727
return;
2828
}
2929
AgentSpan span = startSpan(String.valueOf(depth));
30-
try (AgentScope scope = activateSpan(span, true)) {
30+
try (AgentScope scope = activateSpan(span)) {
3131
if (depth % 2 == 0) {
3232
executor.submit(
3333
new RecursiveThreadPoolMixedSubmissionAndExecution(executor, maxDepth, depth + 1));

dd-java-agent/instrumentation/java-concurrent/src/test/java/executor/recursive/RecursiveThreadPoolSubmission.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void run() {
2626
return;
2727
}
2828
AgentSpan span = startSpan(String.valueOf(depth));
29-
try (AgentScope scope = activateSpan(span, true)) {
29+
try (AgentScope scope = activateSpan(span)) {
3030
executor.submit(new RecursiveThreadPoolSubmission(executor, maxDepth, depth + 1));
3131
} finally {
3232
span.finish();

dd-java-agent/instrumentation/java-concurrent/src/test/java/forkjoin/LinearTask.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected Integer compute() {
3434
} else {
3535
int next = parent + 1;
3636
AgentSpan span = startSpan(Integer.toString(next));
37-
try (AgentScope scope = activateSpan(span, true)) {
37+
try (AgentScope scope = activateSpan(span)) {
3838
LinearTask child = new LinearTask(next, depth);
3939
return child.fork().join();
4040
} finally {

dd-java-agent/instrumentation/java-http-client/src/main/java11/datadog/trace/instrumentation/httpclient/SendAsyncAdvice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static AgentScope methodEnter(
3131
return null;
3232
}
3333
final AgentSpan span = AgentTracer.startSpan(JavaNetClientDecorator.OPERATION_NAME);
34-
final AgentScope scope = activateSpan(span, true);
34+
final AgentScope scope = activateSpan(span);
3535
if (bodyHandler != null) {
3636
bodyHandler = new BodyHandlerWrapper<>(bodyHandler, captureSpan(span));
3737
}

dd-java-agent/instrumentation/jax-rs-annotations-1/src/main/java/datadog/trace/instrumentation/jaxrs1/JaxRsAnnotationsInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static AgentScope nameSpan(
100100
DECORATE.onJaxRsSpan(span, parent, target.getClass(), method);
101101
DECORATE.afterStart(span);
102102

103-
return activateSpan(span, true);
103+
return activateSpan(span);
104104
}
105105

106106
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static AgentScope createGenericSpan(@Advice.This final ContainerRequestCo
4747
// can only be aborted inside the filter method
4848
}
4949

50-
final AgentScope scope = activateSpan(span, true);
50+
final AgentScope scope = activateSpan(span);
5151

5252
DECORATE.afterStart(span);
5353
DECORATE.onJaxRsSpan(span, parent, filterClass, method);

dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAnnotationsInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static AgentScope nameSpan(
131131
DECORATE.onJaxRsSpan(span, parent, target.getClass(), method);
132132
DECORATE.afterStart(span);
133133

134-
final AgentScope scope = activateSpan(span, true);
134+
final AgentScope scope = activateSpan(span);
135135

136136
if (contextStore != null && asyncResponse != null) {
137137
contextStore.put(asyncResponse, span);

dd-java-agent/instrumentation/jax-rs-annotations-2/src/main/java/datadog/trace/instrumentation/jaxrs2/RequestFilterHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static AgentScope createOrUpdateAbortSpan(
2727
parent = activeSpan();
2828
span = startSpan(JAX_RS_REQUEST_ABORT);
2929

30-
final AgentScope scope = activateSpan(span, true);
30+
final AgentScope scope = activateSpan(span);
3131

3232
DECORATE.afterStart(span);
3333
DECORATE.onJaxRsSpan(span, parent, resourceClass, method);

dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/DataSourceInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static AgentScope start(@Advice.This final DataSource ds) {
6969

7070
span.setResourceName(DECORATE.spanNameForMethod(ds.getClass(), "getConnection"));
7171

72-
return activateSpan(span, true);
72+
return activateSpan(span);
7373
}
7474

7575
@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)

dd-java-agent/instrumentation/jetty-11/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static AgentScope onEnter(
2828

2929
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(req);
3030
span = DECORATE.startSpan(req, extractedContext);
31-
final AgentScope scope = activateSpan(span, true);
31+
final AgentScope scope = activateSpan(span);
3232
span.setMeasured(true);
3333
DECORATE.afterStart(span);
3434
DECORATE.onRequest(span, req, req, extractedContext);

dd-java-agent/instrumentation/jetty-12/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void onExit(
3030

3131
final AgentSpanContext.Extracted extractedContext = JettyDecorator.DECORATE.extract(req);
3232
final AgentSpan span = JettyDecorator.DECORATE.startSpan(req, extractedContext);
33-
try (final AgentScope scope = activateSpan(span, true)) {
33+
try (final AgentScope scope = activateSpan(span)) {
3434
span.setMeasured(true);
3535
JettyDecorator.DECORATE.afterStart(span);
3636
JettyDecorator.DECORATE.onRequest(span, req, req, extractedContext);

dd-java-agent/instrumentation/jetty-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static AgentScope onEnter(
158158

159159
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(req);
160160
span = DECORATE.startSpan(req, extractedContext);
161-
final AgentScope scope = activateSpan(span, true);
161+
final AgentScope scope = activateSpan(span);
162162
DECORATE.afterStart(span);
163163
DECORATE.onRequest(span, req, req, extractedContext);
164164

dd-java-agent/instrumentation/jetty-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyServerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public static AgentScope onEnter(
159159

160160
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(req);
161161
span = DECORATE.startSpan(req, extractedContext);
162-
final AgentScope scope = activateSpan(span, true);
162+
final AgentScope scope = activateSpan(span);
163163
DECORATE.afterStart(span);
164164
DECORATE.onRequest(span, req, req, extractedContext);
165165

dd-java-agent/instrumentation/jetty-9/src/main/java/datadog/trace/instrumentation/jetty9/JettyServerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public static AgentScope onEnter(
173173

174174
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(req);
175175
span = DECORATE.startSpan(req, extractedContext);
176-
final AgentScope scope = activateSpan(span, true);
176+
final AgentScope scope = activateSpan(span);
177177
DECORATE.afterStart(span);
178178
DECORATE.onRequest(span, req, req, extractedContext);
179179

dd-java-agent/instrumentation/jetty-9/src/main/java_jetty10/datadog/trace/instrumentation/jetty10/HandleAdvice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static AgentScope onEnter(
3030
DECORATE.afterStart(span);
3131
DECORATE.onRequest(span, req, req, extractedContext);
3232

33-
final AgentScope scope = activateSpan(span, true);
33+
final AgentScope scope = activateSpan(span);
3434
req.setAttribute(DD_SPAN_ATTRIBUTE, span);
3535
req.setAttribute(CorrelationIdentifier.getTraceIdKey(), GlobalTracer.get().getTraceId());
3636
req.setAttribute(CorrelationIdentifier.getSpanIdKey(), GlobalTracer.get().getSpanId());

dd-java-agent/instrumentation/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void onCompletion(final RecordMetadata metadata, final Exception exceptio
3939
span.finish();
4040
if (callback != null) {
4141
if (parent != null) {
42-
try (final AgentScope scope = activateSpan(parent, true)) {
42+
try (final AgentScope scope = activateSpan(parent)) {
4343
callback.onCompletion(metadata, exception);
4444
}
4545
} else {

dd-java-agent/instrumentation/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaProducerCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void onCompletion(final RecordMetadata metadata, final Exception exceptio
3838
span.finish();
3939
if (callback != null) {
4040
if (parent != null) {
41-
try (final AgentScope scope = activateSpan(parent, true)) {
41+
try (final AgentScope scope = activateSpan(parent)) {
4242
callback.onCompletion(metadata, exception);
4343
}
4444
} else {

dd-java-agent/instrumentation/liberty-20/src/main/java/datadog/trace/instrumentation/liberty20/LibertyServerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static class HandleRequestAdvice {
108108
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(request);
109109
request.setAttribute(DD_EXTRACTED_CONTEXT_ATTRIBUTE, extractedContext);
110110
final AgentSpan span = DECORATE.startSpan(request, extractedContext);
111-
scope = activateSpan(span, true);
111+
scope = activateSpan(span);
112112
if (Config.get().isJeeSplitByDeployment()) {
113113
final IWebAppDispatcherContext dispatcherContext = request.getWebAppDispatcherContext();
114114
if (dispatcherContext != null) {

dd-java-agent/instrumentation/liberty-23/src/main/java/datadog/trace/instrumentation/liberty23/LibertyServerInstrumentation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static class HandleRequestAdvice {
110110
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(request);
111111
request.setAttribute(DD_EXTRACTED_CONTEXT_ATTRIBUTE, extractedContext);
112112
final AgentSpan span = DECORATE.startSpan(request, extractedContext);
113-
scope = activateSpan(span, true);
113+
scope = activateSpan(span);
114114
if (Config.get().isJeeSplitByDeployment()) {
115115
final IWebAppDispatcherContext dispatcherContext = request.getWebAppDispatcherContext();
116116
if (dispatcherContext != null) {

dd-java-agent/instrumentation/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientResponseTracingHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent
4848
}
4949

5050
// We want the callback in the scope of the parent, not the client span
51-
try (final AgentScope scope = activateSpan(parent, true)) {
51+
try (final AgentScope scope = activateSpan(parent)) {
5252
ctx.sendUpstream(msg);
5353
}
5454
}
@@ -76,7 +76,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws
7676
}
7777

7878
// We want the callback in the scope of the parent, not the client span
79-
try (final AgentScope scope = activateSpan(parent, true)) {
79+
try (final AgentScope scope = activateSpan(parent)) {
8080
super.exceptionCaught(ctx, e);
8181
}
8282
}

dd-java-agent/instrumentation/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerRequestTracingHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent
3535
if (span == null) {
3636
ctx.sendUpstream(msg); // superclass does not throw
3737
} else {
38-
try (final AgentScope scope = activateSpan(span, true)) {
38+
try (final AgentScope scope = activateSpan(span)) {
3939
ctx.sendUpstream(msg); // superclass does not throw
4040
}
4141
}
@@ -50,7 +50,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent
5050
channelTraceContext.reset();
5151
channelTraceContext.setRequestHeaders(headers);
5252

53-
try (final AgentScope scope = activateSpan(span, true)) {
53+
try (final AgentScope scope = activateSpan(span)) {
5454
DECORATE.afterStart(span);
5555
DECORATE.onRequest(span, ctx.getChannel(), request, context);
5656

dd-java-agent/instrumentation/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientResponseTracingHandler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
3737
}
3838

3939
// We want the callback in the scope of the parent, not the client span
40-
try (final AgentScope scope = activateSpan(parent, true)) {
40+
try (final AgentScope scope = activateSpan(parent)) {
4141
ctx.fireChannelRead(msg);
4242
}
4343
}
@@ -58,7 +58,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E
5858
}
5959
}
6060
// We want the callback in the scope of the parent, not the client span
61-
try (final AgentScope scope = activateSpan(parent, true)) {
61+
try (final AgentScope scope = activateSpan(parent)) {
6262
super.exceptionCaught(ctx, cause);
6363
}
6464
}
@@ -76,7 +76,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
7676
}
7777
}
7878
// We want the callback in the scope of the parent, not the client span
79-
try (final AgentScope scope = activateSpan(parent, true)) {
79+
try (final AgentScope scope = activateSpan(parent)) {
8080
super.channelInactive(ctx);
8181
}
8282
}

dd-java-agent/instrumentation/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
3131
if (span == null) {
3232
ctx.fireChannelRead(msg); // superclass does not throw
3333
} else {
34-
try (final AgentScope scope = activateSpan(span, true)) {
34+
try (final AgentScope scope = activateSpan(span)) {
3535
ctx.fireChannelRead(msg); // superclass does not throw
3636
}
3737
}
@@ -43,7 +43,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
4343
final AgentSpanContext.Extracted extractedContext = DECORATE.extract(headers);
4444
final AgentSpan span = DECORATE.startSpan(headers, extractedContext);
4545

46-
try (final AgentScope scope = activateSpan(span, true)) {
46+
try (final AgentScope scope = activateSpan(span)) {
4747
DECORATE.afterStart(span);
4848
DECORATE.onRequest(span, channel, request, extractedContext);
4949

0 commit comments

Comments
 (0)