My purpose is to trace every request to my system. I watched 2 video below on Youtube to config Micrometer & Zipkin for tracing.
- Implementing Distributed Tracing in Microservices with Spring Boot 3.0, Micrometer, and Zipkin
- Java - Spring Boot 3: Tracing de Microservices con Micrometer y Zipkin
But, when I access http://localhost:9411/zipkin/, it worked abnormally and make me confused.
So I have some questions about it:
- At first, I never perform any requests, why there are so many request on Zipkin dashboard?
- I use Postman to perform three requests (1 from
order-service, 2 fromproduct-service), why it only show the requests fromorder-servicelike this
- Why the spans (Zipkin dashboard) always is 1. Although every requests must go through
api-gateway servicefirst, it is not the same as video 1.
For Micrometer config, I reference Micrometer and Zipkin: How to Trace HTTP Requests in Spring Boot 3
I insert management.tracing.sampling.probability=1.0 to each application.properties file and these dependencies below to each pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-observation</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-brave</artifactId>
</dependency>
This is my architecture system:


First, I try to check
management.tracing.sampling.probability=1.0, and it raise a error:I really don't understand why it like that, after that I found the different, there are 2 denpendencie, they look pretty similar:
I try to reach out the spring docs:
actuator.micrometer-tracing.tracer-implementationsand I realize the dependency I actually need isspring-boot-starter-actuatorI insert three new dependencies from docs:
To summary, we will use these dependencies for tracing http request with Micrometer & Zipkin.