<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-sleuth</artifactId> </dependency>
#是否開啓 sleuth spring.sleuth.enabled=true
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> </dependency>
# 開啓Sleuth spring.sleuth.enabled=true #指定zipkin server的地址,上報追蹤日誌 spring.zipkin.base-url=http://localhost:9411 # 採樣率 越大采集率越高 spring.sleuth.sampler.probability=1
java -jar ipkin-server-2.12.9-exec.jar
java -DSTORAGE_TYPE=elasticsearch -DES_HOSTS=http://localhost:9200 -jar zipkin-server-2.12.9-exec.jar
STORAGE_TYPE用於指定Zipkin的存儲類型,這裏爲elasticsearch
ES_HOSTS 則用於指定Elasticsearch服務器地址列表,有多個節點時使用逗號分隔java