0%
Distributed Tracing with Sleuth and Zipkin

Distributed Tracing with Sleuth and Zipkin

Tracking distributed requests

10-15 min

Distributed Tracing with Sleuth and Zipkin

In this chapter, we will explore how to implement distributed tracing with Spring Cloud Sleuth and Zipkin. We will see how to track and analyze requests across our microservices system.

1. Basic Configuration

Dependencies

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>

Basic configuration

# application.yml
spring:
  application:
    name: product-service
  sleuth:
    otel:
      config:
        trace-id-ratio-based: 1.0
    zipkin:
      base-url: http://localhost:9411
    otel:
      exporter:
        zipkin:
          endpoint: http://localhost:9411/api/v2/spans

2. Zipkin Configuration

Starting Zipkin

docker run -d -p 9411:9411 openzipkin/zipkin

Comments

Comments are powered by GitHub Discussions

Sign in with GitHub to join the discussion

Link copied!