Adding setAsync

Adding setAsync as per review comment
This commit is contained in:
dougqh 2019-09-30 13:50:53 -04:00
parent 1b1cc34ba5
commit 3780cec4f2
1 changed files with 5 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import static net.bytebuddy.matcher.ElementMatchers.*;
import com.google.auto.service.AutoService;
import datadog.trace.agent.tooling.Instrumenter;
import datadog.trace.context.TraceScope;
import io.opentracing.Scope;
import io.opentracing.Span;
import io.opentracing.util.GlobalTracer;
@ -99,6 +100,10 @@ public final class SpringRepositoryInstrumentation extends Instrumenter.Default
}
final Scope scope = GlobalTracer.get().buildSpan("repository.operation").startActive(true);
if (scope instanceof TraceScope) {
((TraceScope) scope).setAsyncPropagation(true);
}
final Span span = scope.span();
DECORATOR.afterStart(span);
DECORATOR.onOperation(span, invokedMethod);