(1)用于追踪服务链路
(2)搭配zipkin实现
(1)下载zipkin.jar
https://repo1.maven.org/maven2/io/zipkin/java/zipkin-server/2.12.9/
(2)运行
java -jar zipkin-server-2.12.9-exec.jar
(3)访问http://localhost:9411/zipkin/
(4)pom.xml增加依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
(5)application.yml增加zipkin和sleuth配置
zipkin:
base-url: http://localhost:9411
sleuth:
sampler:
probability: 1 #1表示全部采集
(6)运行