监控
<!--引入的zipkinServer依赖--> <dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-server</artifactId> <version>2.9.4</version> </dependency> <dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-autoconfigure-ui</artifactId> <version>2.9.4</version> </dependency>
配置内容:解决zipkin服务后台报错
management.metrics.web.server.auto-time-requests=false
启动类上加入@EnableZipkinServer注解启用zipkin服务
代码:https://gitee.com/lm970585581/cloud-config/tree/master/zipkin-server
使用http://localhost:9411登录到页面上
在需要监控链路的服务里面加入下面依赖
加入依赖
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> </dependency>
spring:
zipkin:
base-url: http://localhost:7777 # zipkin服务地址
sleuth:
sampler:
probability: 1 # 抽样百分比
sender:
type: web # 链路类型(kafka,rabbitmq)
实例代码:
扫描二维码关注公众号,回复:
3959699 查看本文章
![](/qrcode.jpg)
https://gitee.com/lm970585581/cloud-config/tree/master/service-aaa /service-bbb /service-ccc
这三个应用进行链接调用时,可以在zipkin的页面中监控到调用情况