6

I’m looking for some distributed tracing technologies for our spring boot services, in the internet, I see we have 2 popular choices I.e opentelemetry agent and spring cloud sleuth.

I see both of the them have good integration support, I’m confused to which one to go for, please give me some suggestions

Srikanth Malyala
  • 941
  • 15
  • 24

2 Answers2

4

As of today, you can find the following announcement on the Sleuth's Spring page:

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).

Additionally, sleuth is not playing nicely when trying to integrate tracing with other java-but-not-spring-exclusive libraries. To afford any such implementation you would need to configure Sleuth to use the open-telemetry tracer.

Thus, my advice would be to go for open-telemetry, unless you have an exclusive reason not to do that.

As for my current approach, I was introducing otel into an established project that is due for a Spring Boot 3 migration next year. I thus opted to use non-sleuth Spring otel libraries to avoid coupling with Sleuth in this short period. I am not sure if that's a good approach, but with a lack of proper Spring 2 -> 3 migration, this way will not be a blocker until you can migrate other deps over

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35
0

Spring Cloud Sleuth provides Spring Boot auto-configuration for distributed tracing using Brave or OpenTelemetry tracer. It supports Context Propagation, Sampling, Baggage. But as per their documentation, Spring Cloud Sleuth is Frozen and Spring Cloud Sleuth will not work with Spring Boot 3.x onward. The last major version of Spring Boot that Sleuth will support is Spring Boot >=2.4.x. The core of this project got moved to Micrometer Tracing project and the instrumentation will be moved to Micrometer and all respective projects.

If you are on Spring Boot 2.x then better to use OpenTelemetry Java Agent. Once you upgraded to Spring Boot 3.x then instrumentation is internally supported using the Micrometer Tracing project. It will contain built-in support for log correlation, W3C context propagation will be the default propagation type, and we will support automatic propagation of metadata.

Hemant Thorat
  • 2,386
  • 20
  • 14