分布式链路追踪

springcloud 寻梦 5年前 (2019-11-05) 415次浏览 0个评论 扫描二维码

服务端是个坑!!!

1 server端下载地址

curl -sSL https://zipkin.io/quickstart.sh | bash -s 

启动

java -jar zipkin-server-2.19.1-exec.jar --zipkin.collector.rabbitmq.addresses=88.88.66.88:5672 --zipkin.collector.rabbitmq.username=8888 --zipkin.collector.rabbitmq.password=987654

访问:
http://localhost:9411/

2 客户端

implementation 'org.springframework.cloud:spring-cloud-starter-zipkin'

配置文件

spring.zipkin.base-url= http://localhost:9411
#Spring Cloud Sleuth有一个Sampler策略,可以通过这个实现类来控制采样算法。采样器不会阻碍span相关id的产生,
# 但是会对导出以及附加事件标签的相关操作造成影响。 Sleuth默认采样算法的实现是Reservoir sampling,具体的实现类是PercentageBasedSampler,
#默认的采样比例为: 0.1(即10%)。不过我们可以通过spring.sleuth.sampler.percentage来设置,所设置的值介于0.0到1.0之间,1.0则表示全部采集。
spring.sleuth.sampler.probability=1.0
喜欢 (1)
[支付宝扫码,感谢支持]
分享 (0)
关于作者:

您必须 登录 才能发表评论!