1.下載zipkin服務端
(1)下載jar包
https://repo1.maven.org/maven2/io/zipkin/java/zipkin-server/2.12.9/zipkin-server-2.12.9-exec.jar
(2)啓動jar
java -jar zipkin-server-2.12.9-exec.jar
訪問: http://127.0.0.1:9411/zipkin
2.微服務端埋點
maven依賴
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
yml配置
spring
sleuth:
web:
client:
enabled: true
sampler:
probability: 1.0 # 將採樣比例設置爲 1.0,也就是全部都需要。默認是 0.1
zipkin:
base-url: http://127.0.0.1:9411/ # 指定了 Zipkin 服務器的地址
訪問:
http://127.0.0.1:9411/zipkin