Spring Cloud Sleuth

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


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.

Specifically, Spring Cloud Sleuth…​

  • Adds trace and span ids to the Slf4J MDC, so you can extract all the logs from a given trace or span in a log aggregator.

  • Instruments common ingress and egress points from Spring applications (servlet filter, rest template, scheduled actions, message channels, feign client).

  • If spring-cloud-sleuth-zipkin is available then the app will generate and report Zipkin-compatible traces via HTTP. By default it sends them to a Zipkin collector service on localhost (port 9411). Configure the location of the service using spring.zipkin.baseUrl.

Spring Boot Config

Add Sleuth to your classpath:




buildscript {
    dependencies {
        classpath "io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE"

apply plugin: "io.spring.dependency-management"

dependencyManagement {
     imports {
          mavenBom "${releaseTrainVersion}"
dependencies {
    compile ''

As long as Spring Cloud Sleuth is on the classpath any Spring Boot application will generate trace data:

public class Application {

  private static Logger log = LoggerFactory.getLogger(DemoController.class);

  public String home() {"Handling home");
    return "Hello World";

  public static void main(String[] args) {, args);


Run this app and then hit the home page. You will see traceId and spanId populated in the logs. If this app calls out to another one (e.g. with RestTemplate) it will send the trace data in headers and if the receiver is another Sleuth app you will see the trace continue there.

  • Instead of logging the request in the handler explicitly, you could set

  • Sleuth defaults to a rate limited sampler. That means that it will sample up to 1000 transactions per second.

  • Set (for instance) to see the service name as well as the trace and span ids.

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.


Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
3.1.3 CURRENT GA Reference Doc.
3.1.4-SNAPSHOT SNAPSHOT Reference Doc.
3.0.5-SNAPSHOT SNAPSHOT Reference Doc.
3.0.4 GA Reference Doc.
2.2.8.RELEASE GA Reference Doc.
Branch Initial Release End of Support End Commercial Support *
2021-11-30 2023-11-18 2025-02-18
2020-12-22 2022-05-19 2023-09-19
2019-11-26 2020-11-26 2022-03-26

OSS support

Free security updates and bugfixes with support from the Spring community. See VMware Tanzu OSS support policy.

Commercial support

Business support from Spring experts during the OSS timeline, plus extended support after OSS End-Of-Life.
Publicly available releases for critical bugfixes and security issues when requested by customers.

Future release

Generation not yet released, timeline is subject to changes.

About commercial support (*)

This page shows the current state of project releases and does not define the commercial support policy. Please refer to the official support policy for more information.