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?
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.
Related
After migrating spring boot from version 2.x to 3 we miss traceId and spanId in our logs.
We removed all sleuth dependencies and added
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-tracing'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation platform('io.micrometer:micrometer-tracing-bom:latest.release')
as well as
logging.pattern.level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
but no traceIds and spanIds are being logged.
Is there something we missed?
You can try following ways (Any one of the following):
Try to remove micrometer core and micrometer tracing dependencies and add actuator dependency it has micrometer core and micrometer observation available with it.
Add micrometer observations dependency.
I'm using Spring Boot 2.6 and Spring Cloud Sleuth 3.1.4
Whenever I run the app I'm getting this:
Your project setup is incompatible with our requirements due to following reasons:
- Spring Boot [2.6.0] is not compatible with this Spring Cloud release train
Action:
Consider applying the following actions:
- Change Spring Boot version to one of the following versions [2.4.x, 2.5.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn].
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]
According to release train 2021.0.x should be compatible with Spring boot 2.6 and sleuth 3.1.4 is a part of it.
Am I missing something here?
In the compatibility matrix, as listed here: https://spring.io/projects/spring-cloud, under 'Release Train' section, this should work.
But, I would recommend you to lower the spring cloud version to 3.1.3 to begin with. If you still get the same error, try with version 3.1.0. as in my project I had no problems using spring-cloud-starter-sleuth 3.1.0 with Spring Boot 2.6.x.
Best regards,
Filip
EDIT: With spring sleuth 3.1.4 you should use spring-cloud-dependencies of version 2021.0.4. Maybe here you got the problem.
I'm trying to build an Gateway API using the new Spring Boot Starter Parent 2.4.2 but, for some reason, looks like the spring-cloud-starter-netflix-zuul isn't supported anymore and doesn't work with the new version! Is there any substitute?
From Spring blog:
Zuul 1 and Archaius 1 have both been superseded by later versions that are not backward compatible.
The following Spring Cloud Netflix modules and corresponding starters will be placed into maintenance mode:
spring-cloud-netflix-archaius
spring-cloud-netflix-hystrix-contract
spring-cloud-netflix-hystrix-dashboard
spring-cloud-netflix-hystrix-stream
spring-cloud-netflix-hystrix
spring-cloud-netflix-ribbon
spring-cloud-netflix-turbine-stream
spring-cloud-netflix-turbine
spring-cloud-netflix-zuul
Replacements
We recommend the following as replacements for the functionality provided by these modules.
Current
Replacement
Hystrix
Resilience4j
Hystrix Dashboard / Turbine
Micrometer + Monitoring System
Ribbon
Spring Cloud Loadbalancer
Zuul 1
Spring Cloud Gateway
Archaius 1
Spring Boot external config + Spring Cloud Config
So you'd need to migrate to Spring Cloud Gateway.
I want to migrate to Micronaut or Quarkus from Spring Boot, but in Spring boot there is one feature as AbstractRoutingDataSource, which in runtime change datasouce. Is there anything similar or any mechanism in micronaut or quarkus which gives opportunity to work with multiple datasources in runtime??
Spring-boot feature for reference https://medium.com/innomizetech/dynamic-multi-database-application-with-spring-boot-7c61a743e914
My colleague offers me a openFeign interface which is based in spring Cloud 2.x, i can't inject it in my service as usuall. (my spring cloud version is Edgware.RELEASE, and may be it may be the initiator of this problem),so what can i do to solve this problem?
As #spencergibb has mentioned in his comment, Edgeware is not compatible with Spring Boot 2.x. You will need to use the Finchley release train:
Please read the Release Train section of the Spring Cloud Documentation.