前言:隨着微服務系統的增長,服務之間的調用關係變得會很是複雜,這給運維以及排查問題帶來了很大的麻煩,這時服務調用監控就顯得很是重要了。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