Fixed not starting Hystrix span

This commit is contained in:
Marcin Grzejszczak
2018-01-29 13:09:20 +01:00
parent 5b13fc0c5e
commit bc59fcc862
2 changed files with 3 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ public abstract class TraceCommand<R> extends HystrixCommand<R> {
this.traceKeys.getHystrix().getCommandGroup(), getCommandGroup().name());
span.tag(this.traceKeys.getHystrix().getPrefix() +
this.traceKeys.getHystrix().getThreadPoolKey(), getThreadPoolKey().name());
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span)) {
try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(span.start())) {
return doRun();
}
finally {

View File

@@ -70,6 +70,8 @@ public class TraceCommandTests {
then(this.reporter.getSpans()).hasSize(1);
then(this.reporter.getSpans().get(0).tags())
.containsEntry("commandKey", "traceCommandKey");
then(this.reporter.getSpans().get(0).duration())
.isGreaterThan(0L);
}
@Test