Fixed not starting of span for @scheduled. fixes gh-1019
This commit is contained in:
@@ -62,7 +62,7 @@ public class TraceSchedulingAspect {
|
||||
}
|
||||
String spanName = SpanNameUtil.toLowerHyphen(pjp.getSignature().getName());
|
||||
Span span = startOrContinueRenamedSpan(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();
|
||||
|
||||
@@ -92,6 +92,7 @@ public class TracingOnScheduledTests {
|
||||
then(this.reporter.getSpans().get(0).tags())
|
||||
.contains(new AbstractMap.SimpleEntry<>("class", "TestBeanWithScheduledMethod"),
|
||||
new AbstractMap.SimpleEntry<>("method", "scheduledMethod"));
|
||||
then(this.reporter.getSpans().get(0).durationAsLong()).isGreaterThan(0L);
|
||||
}
|
||||
|
||||
private void differentSpanHasBeenSetThan(final Span spanToCompare) {
|
||||
|
||||
Reference in New Issue
Block a user