Using concrete tracer to retrieve the current span

This commit is contained in:
Marcin Grzejszczak
2018-01-29 12:04:48 +01:00
parent b747a58347
commit 7f86d37484

View File

@@ -100,7 +100,7 @@ public class TraceRunnableTests {
}
private TraceKeepingRunnable runnableThatRetrievesTraceFromThreadLocal() {
return new TraceKeepingRunnable();
return new TraceKeepingRunnable(this.tracer);
}
private void givenRunnableGetsSubmitted(Runnable runnable) throws Exception {
@@ -132,11 +132,18 @@ public class TraceRunnableTests {
@SpanName("some-runnable-name-from-annotation")
static class TraceKeepingRunnable implements Runnable {
private final Tracer tracer;
public Span span;
TraceKeepingRunnable(Tracer tracer) {
this.tracer = tracer;
}
@Override
public void run() {
this.span = Tracing.currentTracer().currentSpan();
this.span = this.tracer.currentSpan();
}
}