Springboot + Dubbo Zipkin use interface call trace link

Zipkin description:

Zipkin is a distributed link tracking system that can collect data to help locate the timing delays and other related issues. Data can be stored in cassandra, MySQL, ES, mem in. Distributed Link Tracking is an old topic, the country has a similar framework, such as Ali skywalking. zipkin current and SpringCloud ecological linked closely together, have the relevant support.
 
zipkinServer download link:

Link: https: //pan.baidu.com/s/1tbydFqM_WaMH7qe1Ktvw5Q
extraction code: 8o7n

After downloading, use java -jar zipkin-server-2.12.9-exec.jar command starts, starts after the browser to visit http: // localhost: 9411 on it.

 

Project uses a framework Spingboot + Dubbo found that the request interface terminal C responds slowly when the cluster deployment! So Zipkin introduced to track what is called time-consuming service interface
Configuration is as follows:
 
1, pom Zipkin add the required dependencies:
<!--zikpin-->
<dependency>
   <groupId>io.zipkin.brave</groupId>
   <artifactId>brave-instrumentation-dubbo-rpc</artifactId>
   <version>5.4.1</version>
</dependency>
<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-starter-zipkin</artifactId>
   <version>2.0.0.RELEASE</version>
</dependency>

2, is a spring arranged zipkin added:

spring:
  ... omitting other configurations ...
  zipkin:
    enabled: true
    base-url: http://localhost:9411
    messageTimeout: 5
    sender:
      # Send information to trace http
      type: web
  sleuth:
    sampler:
      percentage: 1

 

3, injection tracing filters for dubbo service providers and consumers:

Dubbo: 
 ... ... part of the configuration is omitted consumer: timeout: 15000 check: false retries: 0 filter: 'tracing' provider: retries: 0 filter: 'tracing'

4, declaration specifies that class tracing FILTER

 ①, under the project resources directory new directory META-INFO.dubbo

 ②, create a text file named org.apache.dubbo.rpc.Filter in the above directory

 ③, into the following configuration in the above text file which  

tracing=brave.dubbo.rpc.TracingFilter

 

 

 

Once complete, you can access Zipkin see the specific link tracked!

 

 I am hoping to help you ~

 

Guess you like

Origin www.cnblogs.com/whzbz894/p/12660364.html