Use of SpringCloud sleuth link tracking

zipkin official website

1. Download

1.docker

docker pull openzipkin/zipkin
docker run -d -p 9411:9411 openzipkin/zipkin
Access address: http://localhost:9411
注意:localhost is your actual ip

2.windows

2. Start dependencies

 <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-sleuth</artifactId>

    </dependency>

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>

Set in the SpringCloud configuration file:

 Spring:
  zipkin:
    base-url: http://localhost:9411

3. Access microservices

http://localhost:8080/jobHunting/listJobHunting/sendEmail
http://localhost:7777/auth-service/user/insertGoodsByFeign 此接口是gateway–>auth-service +openfeign —>GoodsService

4. Access zipkin’s UI interface and observe the effect

Insert image description here
Insert image description here

Insert image description here

5. ZipKin data persistence

zipkin persists table sql address

docker  run --name zipkin -d  -p 9412:9411 -e MYSQL_USER=root -e MYSQL_PASS=123456 -e MYSQL_HOST=192.168.170.130 -e STORAGE_TYPE=mysql -e MYSQL_DB=zipkin -e MYSQL_TCP_PORT=3306 openzipkin/zipkin:2.21.7

An error is reported here and has not yet been resolved.

Provider org.mariadb.jdbc.internal.com.send.authentication.SendGssApiAuthPacket could not be instantiated

Provider org.mariadb.jdbc.internal.com.send.authentication.SendGssApiAuthPacket could not be instantiated

Guess you like

Origin blog.csdn.net/weixin_40796433/article/details/129496021