引入Maven依赖

  org.springframework.cloud

  spring-cloud-starter-sleuth

  日志发生的变化

  当应用ClassPath下存在org.springfreamwork.cloud:spring-cloud-starter-sleuth的时候,日志会发生调整。

  激活

  @SpringBootApplication

  public class SpringCloudSleuthDemoApplication {

  public static void main(String[] args) {

  SpringApplication.run(SpringCloudSleuthDemoApplication.class, args);

  }

  }

  Zipkin整合

  创建 Spring Cloud Zipkin服务器

  增加Maven依赖

  io.zipkin.java

  zipkin-server

  2.11.11

  io.zipkin.java

  zipkin-autoconfigure-ui

  2.11.11

  激活Zipkin服务器

  @SpringBootApplication

  @EnableZipkinServer

  public class SpringCloudZipkinDemoApplication {

  public static void main(String[] args) {

  SpringApplication.run(SpringCloudZipkinDemoApplication.class, args);

  }

  }

  HTTP 收集 (HTTP调用)

  简单整合spring-cloud-sleuth

  增加Maven依赖

  org.springframework.cloud

  spring-cloud-starter-zipkin

  Spring Cloud 服务整合

  端口信息

  spring-cloud-zuul:7070

  person-client:8080

  person-service:9090

  Eureka Server:12345

  ZipKin Server:23456

  Config Server:10001

  服务启动顺序

  zipkin Server

  Eureka Server

  spring-cloud-config-server

  person-server

  person-client

  spring-cloud-zuul

  spring-cloud-sleuth

  spring-cloud-sleuth-demo改造

  增加Eureka客户端依赖

  org.springframework.cloud

  spring-cloud-starter-netflix-eureka-client

  配置调整

  spring.application.name = spring-cloud-sleuth

  server.port = 6060

  spring.zipkin.base-url=http://localhost:23456/

  eureka.client.serviceUrl.defaultZone=http://localhost:12345/eureka

  调整代码链接:spring-cloud-zuul

  完整调用链路

  spring-cloud-sleuth → spring-cloud-zuul → person-client → person-service

  @RestController

  public class TestLoggerController {

  final static Logger LOGGER = LoggerFactory.getLogger(TestLoggerController.class);

  @Autowired

  @Qualifier("restTemplate")

  private RestTemplate restTemplate;

  @GetMapping("/send")

  public void send() {

  LOGGER.info(" 欢迎欢迎!");

  }

  @GetMapping("/to/zuul/pseron-clint/findall")

  public Object findall() {

  LOGGER.info("TestLoggerController#findall()");

  return restTemplate.getForObject("http://spring-cloud-zuul/person-client/person/findall", Object.class);

  }

  }

  spring-cloud-zuul上报Zipkin服务器

  依赖无锡人流医院哪家好 http://www.bhnnkyy120.com/

  org.springframework.cloud

  spring-cloud-starter-zipkin

  配置

  spring.zipkin.base-url=http://localhost:23456/

  person-client上报Zipkin服务器

  依赖

  org.springframework.cloud

  spring-cloud-starter-zipkin

  配置

  spring.zipkin.base-url=http://localhost:23456/

  person-service上报Zipkin服务器

  依赖

  org.springframework.cloud

  spring-cloud-starter-zipkin

  配置

  spring.zipkin.base-url=http://localhost:23456/

  Spring Cloud Stream 收集消息(消息)

  调整spring-cloud-zipkin-server 通过Steam来收集

  增加Maven依赖

  org.springframework.cloud

  spring-cloud-sleuth-zipkin-stream

  org.springframework.cloud

  spring-cloud-stream-binder-kafka

  激活Zipkin Stream

  @SpringBootApplication

  //@EnableZipkinServer

  @EnableZipkinStreamServer

  public class SpringCloudZipkinDemoApplication {

  public static void main(String[] args) {

  SpringApplication.run(SpringCloudZipkinDemoApplication.class, args);

  }

  }

  调整spring-cloud-zuul

  增加依赖

  org.springframework.cloud

  spring-cloud-sleuth-stream

  org.springframework.cloud

  spring-cloud-stream-binder-kafka

  org.springframework.cloud

  spring-cloud-starter-sleuth

  注释HTTP上报URL

  ##日志上报

  ##spring.zipkin.base-url=http://localhost:23456/

Spring Cloud Sleuth 整合的更多相关文章

  1. spring cloud 入门系列八:使用spring cloud sleuth整合zipkin进行服务链路追踪

    好久没有写博客了,主要是最近有些忙,今天忙里偷闲来一篇. =======我是华丽的分割线========== 微服务架构是一种分布式架构,微服务系统按照业务划分服务单元,一个微服务往往会有很多个服务单 ...

  2. Spring Cloud Sleuth + Zipkin 链路监控

    原文:https://blog.csdn.net/hubo_88/article/details/80878632 在微服务系统中,随着业务的发展,系统会变得越来越大,那么各个服务之间的调用关系也就变 ...

  3. SpringCloud(7)服务链路追踪Spring Cloud Sleuth

    1.简介 Spring Cloud Sleuth 主要功能就是在分布式系统中提供追踪解决方案,并且兼容支持了 zipkin,你只需要在pom文件中引入相应的依赖即可.本文主要讲述服务追踪组件zipki ...

  4. 【SpringCloud构建微服务系列】分布式链路跟踪Spring Cloud Sleuth

    一.背景 随着业务的发展,系统规模越来越大,各微服务直接的调用关系也变得越来越复杂.通常一个由客户端发起的请求在后端系统中会经过多个不同的微服务调用协同产生最后的请求结果,几乎每一个前端请求都会形成一 ...

  5. Spring Cloud Alibaba学习笔记(23) - 调用链监控工具Spring Cloud Sleuth + Zipkin

    随着业务发展,系统拆分导致系统调用链路愈发复杂一个前端请求可能最终需要调用很多次后端服务才能完成,当整个请求陷入性能瓶颈或不可用时,我们是无法得知该请求是由某个或某些后端服务引起的,这时就需要解决如何 ...

  6. 分布式链路追踪之Spring Cloud Sleuth+Zipkin最全教程!

    大家好,我是不才陈某~ 这是<Spring Cloud 进阶>第九篇文章,往期文章如下: 五十五张图告诉你微服务的灵魂摆渡者Nacos究竟有多强? openFeign夺命连环9问,这谁受得 ...

  7. springcloud(十二):使用Spring Cloud Sleuth和Zipkin进行分布式链路跟踪

    随着业务发展,系统拆分导致系统调用链路愈发复杂一个前端请求可能最终需要调用很多次后端服务才能完成,当整个请求变慢或不可用时,我们是无法得知该请求是由某个或某些后端服务引起的,这时就需要解决如何快读定位 ...

  8. Spring Cloud Sleuth服务链路追踪(zipkin)(转)

    这篇文章主要讲述服务追踪组件zipkin,Spring Cloud Sleuth集成了zipkin组件. 一.简介 Spring Cloud Sleuth 主要功能就是在分布式系统中提供追踪解决方案, ...

  9. 第八篇: 服务链路追踪(Spring Cloud Sleuth)

    一.简介 一个分布式系统由若干分布式服务构成,每一个请求会经过多个业务系统并留下足迹,但是这些分散的数据对于问题排查,或是流程优化都很有限.   要能做到追踪每个请求的完整链路调用,收集链路调用上每个 ...

随机推荐

  1. 套接字编程(TCP)

    json模块补充 json保存的格式中,key值一定要用双引号隔开 import json #把字典转成json格式字符串 dic = {'name': 'lqz', 'xx': False, 'yy ...

  2. swagger 配置- ssm

    swagger 配置 - ssm swagger 是一个用来看接口的工具,具体效果如下,这里用的是swagger2 1.porm.xml <dependency> <groupId& ...

  3. 小学四则运算口算练习app---No.7

    今天主要改了设置页面的提示框以及按钮的闪退问题: activity_calculators .class import android.support.v7.app.AppCompatActivity ...

  4. ESP8266MOD、刷可以使用AT指令的固件、作为客户端向贝壳云端发送固定数据

    硬件部分 1. ESP8266MOD 2. Micro USB数据线一根 实物图:(小灯不必) 硬件准备好之后,直接用数据线连接到电脑即可,然后找到所对应的COM口,记下来备用! 为ESP8266刷A ...

  5. zzulioj - 2624: 小H的奇怪加法

    题目链接:http://acm.zzuli.edu.cn/problem.php?id=2624 题目描述 小H非常喜欢研究算法,尤其是各种加法.没错加法包含很多种,例如二进制中的全加,半加等.全加: ...

  6. localStorage二次封装-----设置过期时间

    export default{ set(key,data,time){ let obj={ data=data, ctime:(new Date()).getTime(),//时间戳,同Date.no ...

  7. GDAL在VS下配置测试

    刚才在VS2013里面配置了一下GDAL,然后就测试了配置成功与否.熟料,竟然发现在微软的Visual Studio 2013版本中,调用MessageBox()这个函数的时候报错了. 错误信息如下 ...

  8. HSA AMD异构计算架构

    当前的CPU和GPU是分立设计的处理器,不能高效率地协同工作,编写同时运行于CPU和GPU的程序也是相当麻烦.由于CPU和GPU拥有独立的地址空间,应用程序不得不明确地控制数据在CPU和GPU之间的流 ...

  9. html中利用flex容器书写的布局样式

    首先页面基本样式见下图: 如有兴趣可以打开https://migloo.gitee.io/front 或者 https://www.igloo.xin/front 进行查看

  10. 2-3-4树(jdk8的TreeMap的红黑树)

    2-3树:插入变成2个节点正常插,变成3个节点就要提升中间节点和分裂子节点,满足:要么没有子节点,要么2个子节点,要么3个子节点. 2-3-4树:插入变成2个不动,插入变成3个不动,插入变成4个提升原 ...