Giter Site home page Giter Site logo

liangfei / brave Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openzipkin/brave

0.0 2.0 0.0 1.44 MB

Java distributed tracing implementation compatible with Zipkin back-end services.

License: Other

Java 94.07% Thrift 2.83% Shell 1.79% Batchfile 1.31%

brave's Introduction

brave

Build Status Maven Central

Brave moved to OpenZipkin. Read more about it here.

Java distributed tracing implementation compatible with Zipkin.

Zipkin is based on Dapper.

dapper (dutch) = brave (english)... so that's where the name comes from.

introduction

I advise you to read the Dapper paper, but in short:

What we want to achieve is understand system behavior and performance of complex distributed systems. We want to do this with minimal impact on existing code by introducing some small common libraries that are reusable and don't interfere with the existing business logic or architecture. Besides not impacting business logic or architecute we off course also want it to have a neglectable impact on performance.

You should use brave instead of Zipkin if:

Brave uses the Zipkin thrift generated classes as part of its api so it is easy to use existing Zipkin components with Brave (zipkin-collector, zipkin-query, zipkin-ui, cassandra store,...).

I'm very thankful to Twitter for open sourcing Zipkin! Is is by seeing their Zipkin video and presentation that I got to know Zipkin/Dapper and that I saw the potential and the simplicity of the solution.

about spans, traces and architecture

  • span: A single client/server request/response. Can have an optional parent span id and is part of a trace.
  • trace: A tree of spans.

Distributed tracing overview

So as you can see a single span is submitted twice:

  • from the client side, the initiator, with cs (client send) and cr (client received) annotations
  • from the server side with sr (server received) and ss (server send) annotations.

The above image shows how I intend to use Brave in production and also how it integrates with the Zipkin back-end components.

The applications and services have Brave integration at client and server side, for example through the RestEasy support module. They submit spans to the ZipkinSpanCollector which submits them to Flume.

I introduced Flume instead of Scribe as Flume is still actively maintained, easier to deploy, has good documentation and extensions are written in Java.

The ZipkinSpanCollectorSink, part of flume-zipkin-collector-sink repo submits spans to the Zipkin collector service. The ZipkinMetricsSink, part of flume-zipkin-metrics-sink module submits custom annotations with duration (to measure certain sections of the code) to the Metrics library. Metrics builds histograms for the metrics and sends the data to a back-end system for storage and visualisation. Metrics supports multiple back-ends but the sink implementation today supports graphite.

If you use the ZooKeeperSamplingTraceFilter from brave-tracefilters module you can enable/disable tracing or adjust sample rate using ZooKeeper as also indicated on the drawing.

Example implementation

The brave-resteasy-example is a good starting point to get you up to speed on how you can implement brave in your own apps.

Maven artifacts

Maven artifacts for each release are published to Maven Central.

Changelog

For an overview of the available releases see Github releases. As of release 2.0 we try to stick to Semantic Versioning.

brave's People

Contributors

adriancole avatar henrikno avatar hzhaofb avatar k-jo avatar klette avatar kristofa avatar leigu avatar mamico avatar michaelsembwever avatar pbetkier avatar ryangardner avatar ryantenney avatar wjam avatar

Watchers

 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.