Ensures that the span operator is applied only once; #770

This commit is contained in:
Marcin Grzejszczak
2018-01-29 11:09:17 +01:00
parent 71fe82aad5
commit 68f107c2b6

View File

@@ -38,13 +38,16 @@ public class TraceReactorAutoConfiguration {
@Configuration
@ConditionalOnBean(Tracer.class)
static class TraceReactorConfiguration {
private static final String SLEUTH_TRACE_REACTOR_KEY = TraceReactorConfiguration.class.getName();
@Autowired Tracer tracer;
@Autowired TraceKeys traceKeys;
@Autowired SpanNamer spanNamer;
@PostConstruct
public void setupHooks() {
Hooks.onLastOperator(ReactorSleuth.spanOperator(this.tracer));
Hooks.onLastOperator(SLEUTH_TRACE_REACTOR_KEY, ReactorSleuth.spanOperator(this.tracer));
Schedulers.setFactory(new Schedulers.Factory() {
@Override public ScheduledExecutorService decorateExecutorService(
String schedulerType,