Hi,
Super simple to reproduce but if I have a simple spring boot webflux application:
@SpringBootApplication
public class SpringBootTracingApplication {
public static void main(String[] args) {
Hooks.enableAutomaticContextPropagation();
SpringApplication.run(SpringBootTracingApplication.class, args);
}
}
...
@RestController
@Slf4j
public class MyController {
@GetMapping
public Mono<Map<String,String>> home() {
log.info("enter home()");
return Mono.just(Map.of("message", "Hello World")).doOnSuccess(response -> log.info("exit home()"));
};
}
Then in spring boot 3.2 the initial log trace is missing
2023-12-01T12:56:37.949Z INFO [tid=,sid=] 93573 --- [ctor-http-nio-2] [ ] com.example.demo.MyController : enter home()
2023-12-01T12:56:37.954Z INFO [tid=6569d805149e5b057aacd77450367167,sid=7aacd77450367167] 93573 --- [ctor-http-nio-2] [6569d805149e5b057aacd77450367167-7aacd77450367167] com.example.demo.MyController : exit home()
Where as in spring boot 3.0.x and 3.1.x the trace works as expected:
2023-12-01T12:58:55.777Z INFO [tid=6569d88f02bf0c298d41dd3354b48abc,sid=8d41dd3354b48abc] 93949 --- [ctor-http-nio-2] com.example.demo.MyController : enter home()
2023-12-01T12:58:55.783Z INFO [tid=6569d88f02bf0c298d41dd3354b48abc,sid=8d41dd3354b48abc] 93949 --- [ctor-http-nio-2] com.example.demo.MyController : exit home()
Thanks
FYI pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>spring-boot-tracing</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot-tracing</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Comment From: mhalbritter
Thanks for the report, I think this is a duplicate of https://github.com/spring-projects/spring-framework/issues/31706.