Autoconfiguration does not work in spring-boot 3.x
frydrycht opened this issue · 1 comments
I am updating my application from spring-boot 2.7.x to 3.x. Found that in updated version autoconfiguration for brave is not processed correctly (version of spring-cloud-sleuth is 3.1.5). I think the reason is the definition of autoconfiguration files in the resources.
In older spring-boot versions (< 2.7.0) you had to specify file resources/META-INF/spring.factories
where you listed all the configurations classes. From version 2.7.0 new way has been introduced. Now you should list all your configuration classes in file resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
(see https://medium.com/spring-boot/auto-configure-your-common-module-in-the-spring-boot-way-32acd3976a70) For the backward compatibility both definition files where supported in spring-boot 2.7.x but it looks that spring-boot 3.x supports only new file.
As I can see in your repo https://github.com/spring-cloud/spring-cloud-sleuth/tree/3.1.x/spring-cloud-sleuth-autoconfigure/src/main/resources/META-INF only old way file is available and I think this is a source of the problems. Please create new way file.
As we write it in the docs and readme Sleuth doesn't work with Boot 3.x, you have to migrate to Micrometer Tracing
Here you have a link to the migration guide - https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide