前言:随着微服务系统的增长,服务之间的调用关系变得会很是复杂,这给运维以及排查问题带来了很大的麻烦,这时服务调用监控就显得很是重要了。spring cloud sleuth实现了对分布式服务的监控解决方案。html
前情回顾请参考:java
Spring Cloud 微服务一:Consul注册中心git
Spring Cloud 微服务二:API网关spring cloud zuulgithub
Spring Cloud 微服务三: API网关Spring cloud gatewayweb
Spring Cloud 微服务四:熔断器Spring cloud hystrixspring
Spring Cloud 微服务五:Spring cloud gateway限流docker
<artifactId>sleuth-server</artifactId> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> </dependency> <dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-server</artifactId> </dependency> <dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-autoconfigure-ui</artifactId> </dependency> </dependencies>
@SpringBootApplication @EnableZipkinServer public class SleuthServerApplication { public static void main(String[] args) { SpringApplication.run(SleuthServerApplication.class, args); } }
server: port: 9411 debug: true spring: application: name: sleuth-server management: metrics: web: server: auto-time-requests: false
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> </dependency>
zipkin: base-url: http://localhost:9411/ sleuth: sampler: probability: 1.0