Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
449 views
in Technique[技术] by (71.8m points)

Spring Sleuth Tracer not there in spring-cloud-sleuth - What is the alternative?

I have used org.springframework.cloud.sleuth.Tracer (1.3.x) to get the current Span and Trace ids. It looks like the 2.x releases of spring-cloud-sleuth-core got rid of it and after a lot of search no replacement is obvious. Please help.

question from:https://stackoverflow.com/questions/66051815/spring-sleuth-tracer-not-there-in-spring-cloud-sleuth-what-is-the-alternative

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Sleuth 2.x was built on top of Brave. You can check the 1.3 -> 2.x Migration Guide to see how to migrate.

To answer your exact question: Sleuth's Tracer was replaced to brave.Tracer, you can inject and use it.

Please notice that Sleuth 3.x has been already released, there is a 2.x -> 3.x Migration-Guide. In 3.0, Sleuth abstracts the tracing libraries away so there is a Sleuth Tracer in 3.x.

I suggest to upgrade to the latest version of Sleuth (this also means upgrading to the lates Spring Boot and Spring Cloud too).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...