All Projects → elodina → go-zipkin

elodina / go-zipkin

Licence: Apache-2.0 License
Zipkin tracing library for Go

Programming Languages

go
31211 projects - #10 most used programming language
Thrift
134 projects

Build Status

Zipkin library for Go

This library focus is to provide maximum flexibility for creating Zipkin traces inside the distributed application. The library presumes the user is familiar with basic Zipkin concepts like annotations, spans, services, etc. Zipkin spans are composed in a stateless fashion. It is up to you how to manage span entities inside the application. Kafka is used as a transport to transfer the completed spans to Zipkin collector.

Quickstart

// ...
import (
    "github.com/elodina/go-zipkin"
)

rate := 10 // tracing rate 1 of 10
brokerAddr := []string{"master:5000"} // Kafka broker endpoint

producer, err := zipkin.DefaultProducer(brokerAddr) if err != nil {
//...
}

tracer := zipkin.NewTracer("ServiceName", rate, producer, zipkin.LocalNetworkIP(), zipkin.DefaultPort(), zipkin.DefaultTopic())

//...
span := tracer.NewSpan("span_name")
span.ServerReceive()
// do work here
span.ServerSendAndCollect()
//...

Examples

You may see the complete end-to-end example here: https://github.com/aShevc/go-zipkin-sample

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].