Link tracking (Distributed Tracing) is a technology for monitoring distributed applications. By collecting and displaying calls and interactions between different components in a distributed system, it helps developers and operations teams understand requests in the system Processes, performance bottlenecks, and exceptions.
1.Zipkin
Zipkin is an open source distributed system link tracking tool for monitoring and tracking the process and performance of requests in distributed systems, helping developers locate problems and optimize performance, while providing an intuitive visual interface to display distributed request calls link.
1.1 Download Zipkin
Quickstart · OpenZipkinhttps://zipkin.io/pages/quickstart.html
1.2 Running Zipkin
java -jar zipkin-server-2.12.9-exec.jar
1.3 Using Zipkin
1.3.1 Configure in microservices that require link tracking
import dependencies
<!--zipkin-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
Configuration in the main configuration class
spring:
zipkin:
base-url: http://localhost:9411
sleuth:
sampler:
probability: 1 #采样率 0-1 100%该微服务的所有请求都被采样
1.3.2 Start the project Open the web page to view the data
http://localhost:9411