1. Open Tracing

2. Skywalking

2.1. ELK+Skywalking

https://juejin.cn/post/7012877514787799071#comment

https://bbs.huaweicloud.com/blogs/273943

https://zhengjianfeng.cn/?p=578

2.2. skywalking VS Sleuth+ZipKin

https://www.cnblogs.com/cbvlog/p/15770726.html

3. Zipkin

官方网址: https://zipkin.io/pages/quickstart.html

参考项目: https://www.cnblogs.com/lori/p/11113665.html 对应 13

https://segmentfault.com/a/1190000020946622?utm_source=tag-newest

本地目录:D:\StudyWorkSpace\SpringCloudLearning\13

原文链接:https://blog.csdn.net/liuminglei1987/article/details/104004884

3.1. 故事

在微服务架构中,必须实现分布式链路追踪,来记录一个请求到底有哪些服务参与,顺序又是怎样,达到每个请求的细节都清晰可见,出了问题,快速定位。

Google 开源了 Dapper 链路追踪组件,并在 2010 年发表了论文《Dapper, a Large-Scale Distributed Systems Tracing Infrastructure》,这篇文章是业内实现链路追踪的标杆和理论基础,具有非常大的参考价值。

目前,链路追踪组件有 Google 的 Dapper,Twitter 的 Zipkin,以及阿里的 Eagleeye (鹰眼)等,都是非常优秀的链路追踪开源组件。

其中,Twitter 的 Zipkin 是基于 google 的分布式监控系统 Dapper(论文)的开源实现,zipkin 用于追踪分布式服务之间的应用数据链路,分析处理延时,帮助我们改进系统的性能和定位故障。

3.2. 安装

Zipkin Server

注意事项:Spring Cloud 从 F 版本开始,已经无需开发者自行构建 Zipkin Server 了,只需下载 jar 运行即可。下载地址为:

https://dl.bintray.com/openzipkin/maven/io/zipkin/java/zipkin-server/。

Docker 方式安装

1
docker run -d -p 9411:9411 openzipkin/zipkin --network microintegration

验证 test.sxd.com:9411/zipkin/

3.3. 工程配置

1
2
3
4
5
6
7
8
9
10
<!--链路追踪start-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!--链路追踪end-->

3.4. 增加配置

1
2
3
4
5
6
spring:
zipkin:
base-url: http://192.168.1.212:9411/
sleuth:
sampler:
probability: 1.0

3.5. Imarket 实施

链路搜索

image-20200716175011876

链路结构

image-20200716174947715

4. Cat

有代码侵入性

5. 参考与感谢

5.1. 黑马

5.1.1. 视频

https://www.bilibili.com/video/BV1154y1r7Mn/?p=3&spm_id_from=pageDriver&vd_source=c5b2d0d7bc377c0c35dbc251d95cf204

5.1.2. 资料

[[skywalking讲义.pdf]]

1
/Users/Enterprise/0003-Architecture/005-分布式专题/分布式链路追踪skywalking