标签:消费者 项目 host release 任务 数据存储 完成 事件 ati
<dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-server</artifactId> </dependency> <dependency> <groupId>io.zipkin.java</groupId> <artifactId>zipkin-autoconfigure-ui</artifactId> </dependency>
eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ server: port: 9411 spring: application: name: zipkin-server
@EnableZipkinServer
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> <version>RELEASE</version> </dependency>
eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ server: port: 5000 spring: application: name: gateway-service sleuth: sampler: percentage: 1.0 zipkin: base-url: http://localhost:9411 zuul: routes: api-a: path: /user-api/** serviceId: user-service api-b: path: /user-api02/** serviceId: user02-service
无需添加其它注解
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zipkin</artifactId> <version>RELEASE</version> </dependency>
eureka: client: serviceUrl: defaultZone: http://localhost:8761/eureka/ server: port: 8762 spring: application: name: user-service zipkin: base-url: http://localhost:9411 sleuth: sampler: percentage: 1.0 #这个可以不写 #spring.zipkin.base-url=http://localhost:9411
无需添加其它注解
依次启动项目,浏览器输入网关请求,访问zipkin http://localhost:9411/
服务链路数据可以存储到 rabbitMQ ,数据库或elasticSearch服务器上。只要简单的集成到zipkin-server模块上即可
标签:消费者 项目 host release 任务 数据存储 完成 事件 ati
原文地址:https://www.cnblogs.com/tanouou/p/12339669.html