Make spring controller spans to handle async
MODIFY
dd-java-agent/instrumentation/spring-web/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java
dd-java-agent/instrumentation/spring-web/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java
@@ -14,6 +14,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
+import datadog.trace.context.TraceScope;
import io.opentracing.Scope;
import io.opentracing.util.GlobalTracer;
import java.lang.reflect.Method;
@@ -107,6 +108,9 @@ public final class HandlerAdapterInstrumentation extends Instrumenter.Default {
final String operationName = DECORATE.spanNameForClass(clazz) + "." + methodName;
final Scope scope = GlobalTracer.get().buildSpan(operationName).startActive(true);
+ if (scope instanceof TraceScope) {
+ ((TraceScope) scope).setAsyncPropagation(true);
+ }
DECORATE.afterStart(scope);
return scope;
}

MODIFY
dd-trace-api/src/main/java/datadog/trace/context/TraceScope.java
dd-trace-api/src/main/java/datadog/trace/context/TraceScope.java
@@ -2,7 +2,7 @@ package datadog.trace.context;
import java.io.Closeable;
-/** An object when can propagate a datadog trace across multiple threads. */
+/** An object that can propagate a datadog trace across multiple threads. */
public interface TraceScope extends Closeable {
/**
* Prevent the trace attached to this TraceScope from reporting until the returned Continuation

Make spring controller spans to handle async