当前位置:网站首页>调用链监控Zipkin、sleuth搭建与整合
调用链监控Zipkin、sleuth搭建与整合
2022-07-06 06:08:00 【雪峰.贵】
前言
sleuth是spring-clude的分布式跟踪解决方案
微服务之间的调用分为4步
- cs client-send
- sr server-receive
- ss server-send
- cr client-receive
所以调用链的监控分为四条记录,记录了谁发送,谁接收,以及时间,耗时等,一条数据记为一个span(跨度),四条一组记为trace(跟踪)
一、Zipkin、sleuth搭建与整合
1.加依赖
spring-cloud-starter-zipkin 包含了spring-cloud-starter-sleuth
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
2.下载zipkin
https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=LATEST&c=exec
zipkin是spring-boot项目,java -jar 启动即可 端口 9411
访问地址http://localhost:9411
3.加配置
spring:
zipkin:
base-url: http://localhost:9411
sleuth:
sampler:
probability: 1.0 #抽样率 默认0.1
4.测试
访问微服务:http://localhost:8084/users/{id}


点击会显示4条数据即一个trace
边栏推荐
- 【微信小程序】搭建开发工具环境
- Redis6 cluster setup
- Buuctf-[bjdctf2020]zjctf, but so (xiaoyute detailed explanation)
- 误差的基本知识
- Seven imperceptible truths in software testing
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- H3C S5820V2_ Upgrade method after stacking IRF2 of 5830v2 switch
- LeetCode 1200. 最小绝对差
- Function of activation function
- Amazon Engineer: eight important experiences I learned in my career
猜你喜欢
随机推荐
数学三大核心领域概述:几何
[web security] nodejs prototype chain pollution analysis
Application du Groupe Li dans gtsam
曼哈顿距离与曼哈顿矩形-打印回字型矩阵
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Redis6 cluster setup
Manhattan distance sum - print diamond
Idea new UI usage
MySQL之基础知识
【无App Push 通用测试方案
Grant Yu, build a web page you want from 0
全链路压测:构建三大模型
数字三角形模型 AcWing 1015. 摘花生
Coordinatorlayout+nestedscrollview+recyclerview pull up the bottom display is incomplete
[leetcode] day96 - the first unique character & ransom letter & letter ectopic word
【Postman】Collections配置运行过程
【API接口工具】postman-界面使用介绍
数学三大核心领域概述:代数
H3C V7 switch configuration IRF
[postman] dynamic variable (also known as mock function)



![[web security] nodejs prototype chain pollution analysis](/img/c5/256ab30e796f0859387585873cee8b.jpg)





![Buuctf-[gxyctf2019] no dolls (xiaoyute detailed explanation)](/img/0a/054b994b29d4c50ede8b23514cf4ee.jpg)