GitHub - spring-attic/spring-cloud-sleuth: Distributed tracing for spring cloud · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert This repository was archived by the owner on Nov 16, 2026. It is now read-only. Branches Tags Open more actions menu Latest commit History 3,479 Commits 3,479 Commits Folders and files Name Name Last commit message Last commit date .github .github .mvn .mvn benchmarks benchmarks docs docs scripts scripts spring-cloud-sleuth-api spring-cloud-sleuth-api spring-cloud-sleuth-autoconfigure spring-cloud-sleuth-autoconfigure spring-cloud-sleuth-brave spring-cloud-sleuth-brave spring-cloud-sleuth-dependencies spring-cloud-sleuth-dependencies spring-cloud-sleuth-instrumentation spring-cloud-sleuth-instrumentation spring-cloud-sleuth-samples spring-cloud-sleuth-samples spring-cloud-sleuth-zipkin spring-cloud-sleuth-zipkin spring-cloud-starter-sleuth spring-cloud-starter-sleuth src/ checkstyle src/ checkstyle tests tests .editorconfig .editorconfig .gitattributes .gitattributes .gitignore .gitignore .settings.xml .settings.xml .springformat .springformat LICENSE.txt LICENSE.txt README.adoc README.adoc asciidoctor.css asciidoctor.css mvnw mvnw mvnw.cmd mvnw.cmd pom.xml pom.xml Repository files navigation Spring Cloud Sleuth is no longer actively maintained.
See the release notes and blog post for more information and next steps. Spring Cloud Sleuth !!!! IMPORTANT !!!! Spring Cloud Sleuth’s last minor version is 3.1. You can check the 3.1.x branch for the latest commits. Warning Spring Cloud Sleuth will not work with Spring Boot 3.x onward. The last major version of Spring Boot that Sleuth will support is 2.x. 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.
You can check the Micrometer Tracing migration guide to learn how to migrate from Spring Cloud Sleuth to Micrometer Tracing. Introduction Spring Cloud Sleuth provides Spring Boot auto-configuration for distributed tracing. Sleuth configures everything you need to get started. This includes where trace data (spans) are reported to, how many traces to keep (sampling), if remote fields (baggage) are sent, and which libraries are traced.
Quick Start Add Spring Cloud Sleuth to the classpath of a Spring Boot application (together with a Tracer implementation) and you will see trace IDs in logs. Example of Sleuth with Brave tracer: <!-- Spring Cloud Sleuth requires a Spring Cloud BOM --> < dependencyManagement > < dependencies > < dependency > < groupId >org.springframework.cloud</ groupId > < artifactId >spring-cloud-dependencies</ artifactId > <!-- Provide the latest stable Spring Cloud release train version (e.g.
2020.0.0) --> < version >${release.train.version}</ version > < type >pom</ type > < scope >import</ scope > </ dependency > </ dependencies > </ dependencyManagement > < dependencies > <!-- Boot's Web support --> < dependency > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-starter-web</ artifactId > </ dependency > <!-- Sleuth with Brave tracer implementation --> < dependency > < groupId >org.springframework.cloud</ groupId > < artifactId >spring-cloud-starter-sleuth</ artifactId > </ dependency > </ dependencies > Consider the following HTTP handler: @ RestController public class DemoController { private static Logger log = LoggerFactory . getLogger ( DemoController . class ); @ RequestMapping ( "/" ) public String home () { log . info ( "Handling home" ); return "Hello World" ; } } If you add that handler to a controller, you can see the calls to home() being traced in the logs (notice the 0b6aaf642574edd3 ids).
2020-10-21 12:01:16.285 INFO [,0b6aaf642574edd3,0b6aaf642574edd3,true] 289589 --- [nio-9000-exec-1] DemoController : Handling home! Note Instead of logging the request in the handler explicitly, you could set logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG . Note Set spring.application.name=myService (for instance) to see the service name as well as the trace and span IDs. Documentation Please visit the documentation page to read more about the project.
Building Basic Compile and Test To build the source you will need to install JDK 1.8. Spring Cloud uses Maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing $ ./mvnw install Note You can also install Maven (>=3.3.3) yourself and run the mvn command in place of ./mvnw in the examples below. If you do that you also might need to add -P spring if your local Maven settings do not contain repository declarations for spring pre-release artifacts.
Note Be aware that you might need to increase the amount of memory available to Maven by setting a MAVEN_OPTS environment variable with a value like -Xmx512m -XX:MaxPermSize=128m . We try to cover this in the .mvn configuration, so if you find you have to do it to make a build succeed, please raise a ticket to get the settings added to source control. The projects that require middleware (i.e. Redis) for testing generally require that a local instance of [Docker]( https://www.docker.com/get-started ) is installed and running.
Documentation The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from src/main/asciidoc . As part of that process it will look for a README.adoc and process it by loading all the includes, but not parsing or rendering it, just copying it to ${main.basedir} (defaults to ${basedir} , i.e. the root of the project). If there are any changes in the README it will then show up after a Maven build as a modified file in the correct place.
Just commit it and push the change. Working with the code If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or Eclipse when working with the code. We use the m2eclipse eclipse plugin for maven support. Other IDEs and tools should also work without issue as long as they use Maven 3.3.3 or better. Activate the Spring Maven profile Spring Cloud projects require the 'spring' Maven profile to be activated to resolve the spring milestone and snapshot repositories.
Use your preferred IDE to set this profile to be active, or you may experience build errors. Importing into eclipse with m2eclipse We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse marketplace". Note Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell m2eclipse to use the right profile for the projects.
If you see many different errors related to the POMs in the projects, check that you have an up to date installation. If you can’t upgrade m2e, add the "spring" profile to your settings.xml . Alternatively you can copy the repository settings from the "spring" profile of the parent pom into your settings.xml . Importing into eclipse without m2eclipse If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command: $ ./mvnw eclipse:eclipse The generated eclipse projects can be imported by selecting import existing projects from the file menu.
Contributing Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below. Sign the Contributor License Agreement Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement .
Signing the contributor�
The rest of this page is on the live site.