Spring Boot 2.0不支持@EnableZipkinServer,所以需要下载Zipkin的服务器
#浏览器打开地址
https://repo1.maven.org/maven2/io/zipkin/java/zipkin-server/2.12.9/
java -jar zipkin-server.2.12.9-exec.jar
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>-->
<!--zipkin依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
#spring.zipkin.base-url指定了Zipkin服务器的地址
spring.zipkin.base-url=http://localhost:9411
#设置使用http的方式传输数据
spring.zipkin.sender.type=web
#1.x版本需要设置为sleuth.sampler.percentage=1.0
#spring.sleuth.sampler.percentage将采样比例设置为1.0,也就是全部都需要。
sleuth.sampler.probability=1.0
#为了更详细的查看服务通信时的日志信息,我们可以将Feign和Sleuth的日志级别设置为debug。在两个项目的配置文件中,加入如下内容即可:
logging.level.org.springframework.cloud.openfeign=debug
logging.level.org.springframework.cloud.sleuth=debug