Describe the bug
I have just spent some hours debugging why RestTemplate
is not propagating traces to Eureka Server. Turns out RestTemplateTransportClientFactory
creates a RestTemplate
instance by calling new RestTemplate()
.
To fix this, RestTemplate.Builder
should be used to create a RestTemplate
in RestTemplateTransportClientFactory
and we get observability support for free.
Now consider the WebFluxWebClient
equivalent
public WebClientTransportClientFactories webClientTransportClientFactories(
ObjectProvider<WebClient.Builder> builder) {
return new WebClientTransportClientFactories(builder::getIfAvailable);
}
Here, as expected, the WebClient.Builder is used, and produced TransportClientFactory has observability support ...
Version: Spring Cloud Starter 2023.0.0
Comment From: OlgaMaciaszek
Thanks for reporting the issue, @ZIRAKrezovic. Makes sense.
Comment From: OlgaMaciaszek
Reopening as changes reverted due to broken tests.