Starts spans in TraceAsyncAspect; fixes gh-1061

This commit is contained in:
Marcin Grzejszczak
2018-08-16 17:34:04 +02:00
parent 01688205a8
commit f5345211f2
2 changed files with 2 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ public class TraceAsyncAspect {
span = this.tracer.nextSpan();
}
span = span.name(spanName);
try(Tracer.SpanInScope ws = this.tracer.withSpanInScope(span)) {
try(Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
span.tag(CLASS_KEY, pjp.getTarget().getClass().getSimpleName());
span.tag(METHOD_KEY, pjp.getSignature().getName());
return pjp.proceed();

View File

@@ -46,5 +46,6 @@ public class TraceAsyncAspectTest {
BDDAssertions.then(this.reporter.getSpans()).hasSize(1);
BDDAssertions.then(this.reporter.getSpans().get(0).name()).isEqualTo("foo-bar");
BDDAssertions.then(this.reporter.getSpans().get(0).timestamp()).isPositive();
}
}