【笔记】Sleuth & Zipkin 学习笔记
前言
Distributed tracing for spring cloud(Github)
spring-cloud/spring-cloud-sleuth为链路跟踪工具,可以在日志中生成链路跟踪记录
Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data.(Github)
openzipkin/zipkin为图表生成工具,可以搭配Sleuth将链路信息生成图表展示
rabbitmq/rabbitmq-server配合spring-cloud/spring-cloud-sleuth和openzipkin/zipkin实现解耦和流量削峰
Sleuth
添加依赖
- Sleuth只需要添加依赖即可完成配置,无需额外配置
1 | <dependency> |
Zipkin
添加依赖
1 | <dependency> |
修改配置文件
1 | spring: |
配置链路抽样比例(可选)
1 | spring: |
启动Zipkin
- 启动Zipkin时,要连接RabbitMQ
下载Jar包
运行Jar包
1 | java -jar zipkin-server-2.12.9-exec.jar --zipkin.collector.rabbitmq.uri=amqp://admin:admin@192.168.64.140:5672 |