docker-compose文件

1
2
3
4
5
6
7
8
9
10
11
12
zipkin:
image: openzipkin/zipkin:2.21
container_name: zipkin
depends_on:
- elasticsearch
restart: always
ports:
- 9411:9411
environment:
- TZ=Asia/Shanghai
- STORAGE_TYPE=elasticsearch
- ES_HOSTS=ES_HOSTS

springCloud 集成

pom 文件引入

1
2
3
4
5
6
7
8
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>

yaml 配置文件配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
spring:
zipkin:
#地址
base-url: base-url
#关闭服务注册
discovery-client-enabled: false
#发送模式
sender:
type: web
#采样数据
sleuth:
sampler:
probability: 1


logging:
level:
org.springframework.cloud.openfeign: debug
org.springframework.cloud.sleuth: debug

作者声明

1
如有问题,欢迎指正!