taro-mall icon indicating copy to clipboard operation
taro-mall copied to clipboard

分布式链路跟踪

Open apersonw opened this issue 4 years ago • 0 comments

一、服务端篇 1、创建一个docker服务端 docker run -d -p 9411:9411 openzipkin/zipkin 二、客户端篇 1、maven pom中添加依赖

<!-- 分布式链路跟踪 -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>

2、配置文件application.yml中添加配置

spring:
  zipkin:
    base-url: http://host:post/
http://host:post/  为服务端的访问地址端口
访问此地址即可查看相关微服务的请求时间

apersonw avatar Jun 29 '20 08:06 apersonw