Skip to content

Commit ef1ed74

Browse files
authored
Simplify activateSpan API to not include async propagation flag (#8557)
These remaining cases were no-op spans which are already not propagated
1 parent bde13e8 commit ef1ed74

File tree

6 files changed

+10
-20
lines changed

6 files changed

+10
-20
lines changed

dd-java-agent/instrumentation/akka-concurrent/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void enter(
8181
return;
8282
}
8383
// Create an active scope with a noop span, and clean all the way to the previous scope
84-
activateSpan(noopSpan(), false);
84+
activateSpan(noopSpan());
8585
}
8686

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

dd-java-agent/instrumentation/akka-concurrent/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static void enter() {
7575
return;
7676
}
7777
// Create an active scope with a noop span, and clean all the way to the previous scope
78-
activateSpan(noopSpan(), false);
78+
activateSpan(noopSpan());
7979
}
8080

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

dd-java-agent/instrumentation/pekko-concurrent/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static void enter(
8181
return;
8282
}
8383
// Create an active scope with a noop span, and clean all the way to the previous scope
84-
activateSpan(noopSpan(), false);
84+
activateSpan(noopSpan());
8585
}
8686

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

dd-java-agent/instrumentation/pekko-concurrent/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoMailboxInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static void enter() {
7676
return;
7777
}
7878
// Create an active scope with a noop span, and clean all the way to the previous scope
79-
activateSpan(noopSpan(), false);
79+
activateSpan(noopSpan());
8080
}
8181

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

dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -906,18 +906,14 @@ public AgentSpan startSpan(
906906
.start();
907907
}
908908

909-
public AgentScope activateSpan(final AgentSpan span) {
910-
return activateSpan(span, DEFAULT_ASYNC_PROPAGATING);
911-
}
912-
913909
@Override
914-
public AgentScope activateSpan(AgentSpan span, boolean isAsyncPropagating) {
915-
return scopeManager.activate(span, ScopeSource.INSTRUMENTATION, isAsyncPropagating);
910+
public AgentScope activateSpan(AgentSpan span) {
911+
return scopeManager.activate(span, ScopeSource.INSTRUMENTATION, DEFAULT_ASYNC_PROPAGATING);
916912
}
917913

918914
@Override
919915
public AgentScope activateManualSpan(final AgentSpan span) {
920-
return scopeManager.activate(span, ScopeSource.MANUAL);
916+
return scopeManager.activate(span, ScopeSource.MANUAL /* inherit async propagation flag */);
921917
}
922918

923919
@Override

internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package datadog.trace.bootstrap.instrumentation.api;
22

3-
import static datadog.trace.api.ConfigDefaults.DEFAULT_ASYNC_PROPAGATING;
4-
53
import datadog.trace.api.ConfigDefaults;
64
import datadog.trace.api.DDTraceId;
75
import datadog.trace.api.EndpointCheckpointer;
@@ -86,11 +84,7 @@ public static AgentSpan startSpan(
8684
}
8785

8886
public static AgentScope activateSpan(final AgentSpan span) {
89-
return get().activateSpan(span, DEFAULT_ASYNC_PROPAGATING);
90-
}
91-
92-
public static AgentScope activateSpan(final AgentSpan span, final boolean isAsyncPropagating) {
93-
return get().activateSpan(span, isAsyncPropagating);
87+
return get().activateSpan(span);
9488
}
9589

9690
/**
@@ -339,7 +333,7 @@ AgentSpan startSpan(
339333
long startTimeMicros);
340334

341335
/** Activate a span from inside auto-instrumentation. */
342-
AgentScope activateSpan(AgentSpan span, boolean isAsyncPropagating);
336+
AgentScope activateSpan(AgentSpan span);
343337

344338
/** Activate a span from outside auto-instrumentation, i.e. a manual or custom span. */
345339
AgentScope activateManualSpan(AgentSpan span);
@@ -480,7 +474,7 @@ public AgentSpan startSpan(
480474
}
481475

482476
@Override
483-
public AgentScope activateSpan(final AgentSpan span, final boolean isAsyncPropagating) {
477+
public AgentScope activateSpan(final AgentSpan span) {
484478
return NoopScope.INSTANCE;
485479
}
486480

0 commit comments

Comments
 (0)