Important
To ensure that your application name is properly displayed in Zipkin, set the spring.application.name
property in bootstrap.yml
.
方式一、Only Sleuth (log correlation)
方式二、Sleuth with Zipkin via HTTP通過Http方式收集追蹤數據
另外還需要配置yaml參數
spring.zipkin:
base-url: http://localhost:9411
spring.sleuth:
sampler:
probability: 1.0
方式三、Sleuth with Zipkin over RabbitMQ or Kafka 通過消息中間件收集追蹤數據
配置yaml文件參數
#================rabbitmq====================
spring.rabbitmq:
host: 192.168.1.243
virtual-host: /
#與web訪問端口15672不一樣
port: 5672
username: rm_admin
password: 12345678
#=================zipkin=====================
spring.zipkin:
#base-url: http://localhost:9411
sender:
type: rabbit
enable: true
#=================sleuth=====================
spring.sleuth:
web:
client:
enabled: true
sampler:
#設置採樣比例,1.0表示100%,即全部都要;默認是0.1
probability: 1.0