I recently migrated to Spring Boot 3.2 and I'm having issues with trace-id and span-id not being printed in logs when a RestTemplate bean is annotated with @LoadBalanced.

The pic attached below is when a RestTemplate bean is created without the @LoadBalanced annotation and trace-id and span-id is included SpringBoot Spring Boot 3.2 - Facing issues with trace-id and span-id not being printed in logs when spring-cloud-loadbalancer is used.

And the below pic when a RestTemplate is created with the @LoadBalanced annotation and trace-id and span-id is empty SpringBoot Spring Boot 3.2 - Facing issues with trace-id and span-id not being printed in logs when spring-cloud-loadbalancer is used.

The log being printed above is a part of a @GetMapping whose controller has no dependency with the created RestTemplate.

I've attached the sample project I used to replicate the issue. demo.zip

Comment From: wilkinsona

Thanks for the sample. Given that this works without @LoadBalanced, please report this to the Spring Cloud team who maintain the load balancing functionality.