springcloud11-链路追踪组件Zipkin+Sleuth实战

一、可视化链路追踪系统Zipkin部署
  简介:讲解Zipkin的介绍和部署
  1、什么是zipkin
    官网:https://zipkin.io/
    大规模分布式系统的APM工具(Application Performance Management),基于Google Dapper的基础实现,和sleuth结合可以提供可视化web界面分析调用链路耗时情况

  2、同类产品
    鹰眼(EagleEye)
    CAT
    twitter开源zipkin,结合sleuth
    Pinpoint,运用JavaAgent字节码增强技术
    StackDriver Trace (Google)

  3、开始使用
    https://github.com/openzipkin/zipkin
    https://zipkin.io/pages/quickstart.html

    zipkin组成:Collector、Storage、Restful API、Web UI组成

  4、知识拓展:OpenTracing
    OpenTracing 已进入 CNCF,正在为全球的分布式追踪,提供统一的概念和数据标准。
    通过提供平台无关、厂商无关的 API,使得开发人员能够方便的添加(或更换)追踪系统的实现。


推荐阅读:
  http://blog.daocloud.io/cncf-3/
  https://www.zhihu.com/question/27994350
  https://yq.aliyun.com/articles/514488?utm_content=m_43347

 

二、高级篇幅之链路追踪组件Zipkin+Sleuth实战
  简介:使用Zipkin+Sleuth业务分析调用链路分析实战

  1、文档
    http://cloud.spring.io/spring-cloud-static/Finchley.SR1/single/spring-cloud.html#_sleuth_with_zipkin_via_http
    sleuth收集跟踪信息通过http请求发送给zipkin server,zipkinserver进行跟踪信息的存储以及提供Rest API即可,Zipkin UI调用其API接口进行数据展示

    默认存储是内存,可也用mysql、或者elasticsearch等存储

  2、加入依赖
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-zipkin</artifactId>
    </dependency>

    里面包含 spring-cloud-starter-sleuth、spring-cloud-sleuth-zipkin

  3、文档说明:http://cloud.spring.io/spring-cloud-static/Finchley.SR1/single/spring-cloud.html#_features_2

  4、配置zipkin.base-url

  5、配置采样百分闭spring.sleuth.sampler

spring:
  application:
    name: order-service
  zipkin:
        base-url: http://localhost:9411/
  sleuth:
    sampler:
      probability: 1

 

推荐资料:
  https://blog.csdn.net/jrn1012/article/details/77837710

posted @ 2019-05-31 11:08  valar-dohaeris  阅读(282)  评论(0)    收藏  举报