WebClient reuses current trace context if present; fixes gh-1891

This commit is contained in:
Marcin Grzejszczak
2021-04-01 09:18:19 +02:00
parent 5ab1c13f0c
commit 017caaf9b2

View File

@@ -113,6 +113,9 @@ public final class TraceExchangeFilterFunction implements ExchangeFilterFunction
}
ClientRequestWrapper wrapper = new ClientRequestWrapper(this.request);
TraceContext parent = context.hasKey(TraceContext.class) ? context.get(TraceContext.class) : null;
if (parent == null) {
parent = this.currentTraceContext.context();
}
Span span = handler.handleSend(wrapper, parent);
if (log.isTraceEnabled()) {
log.trace("HttpClientHandler::handleSend: " + span);