Improved WebClient parent-child relation; fixes gh-1516

This commit is contained in:
Marcin Grzejszczak
2020-01-13 11:36:08 +01:00
parent a2e73ce0b4
commit 8f5bcdabd7

View File

@@ -162,12 +162,15 @@ final class TraceExchangeFilterFunction implements ExchangeFilterFunction {
if (log.isDebugEnabled()) {
log.debug("Instrumenting WebClient call");
}
Span parentSpan = tracer().currentSpan();
Span span = handler().handleSend(wrapper);
if (log.isDebugEnabled()) {
log.debug("Handled send of " + span);
}
return new MonoWebClientTrace(next, wrapper.buildRequest(), this, span);
MonoWebClientTrace trace = new MonoWebClientTrace(next, wrapper.buildRequest(),
this, span);
tracer().withSpanInScope(parentSpan);
return trace;
}
@SuppressWarnings("unchecked")