Code Monkey home page Code Monkey logo

spingcloud-zipkin-elk-demo's Introduction

基于Springboot1.5.9+SpringCloud+Zipkin+ELK链路跟踪实现

  1. **实现:
    基于zipkin和feign结合,生成span数据,写到本地文件,然后通过logstash发送到es,通过zipkin-ui或Kibana来展示

  2. 工程包目录介绍:

    zipkin-common 公共组件包,主要实现logback过滤对中文的转义以及本demo重点核心:扩展Zipkin的span发送器
    zipkin-eureka 注册中心
    zipkin-provider-a/b 服务提供
    zipkin-consumer 服务消费
    zipkin-server zipkin链路跟踪UI展示

  3. 扩展Zipkin的span发送器说明:

    3.1 翻Spring-cloud-sleuth-zipkin源码,知道其工作主要线路:
    resources/META-INF/spring.factoires/[ZipkinAutoConfiguration] --> [ZipkinSpanReporter] -> [HttpZipkinSpanReporter] -> [RestTemplateSender]--> [AsyncReporter] -> [Sender.sendSpans]
    3.2 至于如何封装成Span的不在本文描述范围
    3.3 基于以上我们扩展一个Sender,实现sendSpans方法的实现,改为slf4j日志打印即可将feign产生的Span信息保存到本地文件
    3.4 详情请参考com.xiao.zipkin.common.zipkin包的内容实现
    3.5 logback-spring.xml参考

  4. logstash 配置(待补充):
    ELK环境搭建请自行查阅资料安装

     
    
  5. 更多参考资料:
    构建sleuth+zipkin全链路监控系统
    sleuth+zipkin+kafka+logstash链路追踪二次开发方案
    分布式链路追踪技术对比

  6. Github地址

spingcloud-zipkin-elk-demo's People

Contributors

xlinlin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.