当前位置:网站首页>Sleuth + Zipkin
Sleuth + Zipkin
2022-06-23 16:05:00 【weixin_ forty-three million seven hundred and sixty-six thousan】
Sleuth + Zipkin
1. sleuth What is it? ?
- Spring Cloud Sleuth It provides a distributed tracking solution for microservices .
- Sleuth For distributed link tracing, only trace data is generated , These data are not easy to read , So the tracking data is usually uploaded to Zipkin Server, from Zipkin adopt UI The interface displays data uniformly .
2. sleuth What makes up ?
span( span ): Basic work unit . Use one 64 Bit id Unique identification . except id Outside ,span There are other data , For example, describe 、 Timestamp event 、 Comments on key value pairs ( label ),spanId、parentId etc. .
trace( track ):trace It's a group. span A tree structure of composition , Use one 64 Bit id Unique identification ,trace All in span Share the trace Of id.
traceId : Assigned to a request ID Number , Used to identify a request link .
spanId : A basic unit of work , A request can contain multiple steps , Each step has its own spanId. A request contains a TraceId, Multiple SpanId.
3. Zipkin What is it? ?
- Zipkin It is a distributed real-time data tracking system . Its main function is to collect the time series data of the system , So as to track the system delay of the microservice architecture , Monitoring and tracking link calls ,Zipkin It also provides a very friendly UI Interface , To help analyze the tracking data .
- Zipkin It provides pluggable data storage mode :In-Memory、MySql、Cassandra as well as Elasticsearch.
4. zipkin What makes up ?

Collector: Collector as , It is mainly used to process tracking information sent from external systems , Convert this information to Zipkin Internally processed Span Format , To support subsequent storage 、 analysis 、 Display and other functions .
Storage: Storage component , It mainly processes the trace information received by the collector , This information is stored in memory by default , We can also modify this storage policy , Store trace information into the database by using other storage components .
RESTful API:API Components , It is mainly used to provide external access interface . For example, display tracking information to clients or access external system to realize monitoring, etc .
Web UI:UI Components , be based on API Upper application of component implementation , adopt UI Component users can easily and intuitively query and analyze tracking information .
5. Sleuth + Zipkin Implement the distributed link tracking process ?
Zipkin Divided into two ends , One is Zipkin Server side , One is Zipkin client , The client is also the application of microservices . The client will configure the server URL Address , Once a call between services occurs , It will be configured in microservices Sleuth Monitor monitoring of , And generate the corresponding Trace and Span Send information to the server ( There are two main ways to send , One is HTTP Message mode , There is also a way of message bus, such as :RabbitMQ), Final ZipKin adopt UI The interface displays the data .
summary :Sleuth and Zipkin It's like Spring Boot Actuator and Spring Boot Admin The relationship between , One for generating data , One for displaying data .
6. Sleuth + Zipkin Implementation of distributed link tracking details ?
- stay zuul The gateway implements a OncePerRequestFilter filter , Inject Zipkin Of Tracer take traceId and spanId Add to response header , It is convenient to view the interface call link
String traceId = tracer.currentSpan().context().traceIdString();
String spanId = tracer.currentSpan().context().spanIdString();
httpServletResponse.setHeader("traceId",traceId+","+spanId);
边栏推荐
猜你喜欢

window远程桌面连接互传文件加速小技巧

【TcaplusDB知识库】TcaplusDB Tmonitor模块架构介绍

万字攻略,详解腾讯面试(T1-T9)核心技术点,面试题整理

Sleuth + Zipkin
![[tcapulusdb knowledge base] tcapulusdb tmonitor module architecture introduction](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb tmonitor module architecture introduction

总结一下购买阿里云服务器的经验

Block, non block, multiplexing, synchronous, asynchronous, bio, NiO, AIO
![[tcapulusdb knowledge base] Introduction to new models of tcapulusdb](/img/2a/1d7f12c99b92d143e142ade8bc90f9.png)
[tcapulusdb knowledge base] Introduction to new models of tcapulusdb

SSRS页面配置Postgresql data source的方法

Thread pool
随机推荐
【TcaplusDB知识库】TcaplusDB新增机型介绍
5 minutes to quickly launch web applications and APIs (vercel)
B. AND 0, Sum Big-Codeforces Round #716 (Div. 2)
The running rabbit fell
npm 如何发包 删包
批量注册组件
Redis集群操作的方法
进阶开发- 泛型入门基础类测试
VIM backup history command
线程池
matlab: 如何从一些数据里知道是由哪些数据相加得出一个已知数
证券开户的优惠怎样才能得到?在线开户安全么?
[MAE]Masked Autoencoders掩膜自编码器
Ten thousand words introduction, detailed explanation of the core technical points of Tencent interview (t1-t9), and arrangement of interview questions
C. Set or Decrease-Educational Codeforces Round 120 (Rated for Div. 2)
FPGA 常用缩写及单词在工程领域内的意义
Stone from another mountain - Intelligent Question and answer technology in wechat search
Memory consistency and cache consistency
B. Integers Shop-Hello 2022
服务器的部署及使用说明