Spring Cloud Sleuth with Spring Boot 3.0 and Tracer

I use spring sleuth in my project and after I updated spring-boot to version 3 I receive the following error:

Consider defining a bean of type 'org.springframework.cloud.sleuth.Tracer' in your configuration.

I inject Tracer in my logging service to get current traceId and spanId. This is the dependency for spring sleuth:

implementation 'org.springframework.cloud:spring-cloud-starter-sleuth:3.1.5'

Is Tracer Bean no longer built in in terms of spring boot v3?

>Solution :

Spring Cloud Sleuth’s last minor version is 3.1. You can check the 3.1.x branch for the latest commits. The core of this project got moved to Micrometer Tracing project and the instrumentations will be moved to Micrometer and all respective projects (no longer all instrumentations will be done in a single repository).

see: https://spring.io/projects/spring-cloud-sleuth

This means that for Boot 3.x you need to use Micrometer Tracing instead of Sleuth.

Leave a Reply