Zipkin tracer library for go
Switch branches/tags
Clone or download
anuraaga and basvanbeek Add gRPC client handler. (#95)
* Adds gRPC client handler
* Removes Go 1.8 support
Latest commit 006f66d Nov 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
idgenerator made randomTimestamped traceID generator AWS X-Ray friendly Feb 27, 2018
middleware Add gRPC client handler. (#95) Nov 30, 2018
model fixes go vet issue with repeating struct tag on tip Sep 17, 2018
propagation minor code formatting improvements Apr 17, 2018
proto Add gRPC client handler. (#95) Nov 30, 2018
reporter [#63] Fixes kafka reporter. Jun 4, 2018
.gitattributes Add gRPC client handler. (#95) Nov 30, 2018
.gitignore Add gRPC client handler. (#95) Nov 30, 2018
.travis.yml Add gRPC client handler. (#95) Nov 30, 2018
LICENSE first stab at basic span model (using V2 api as native container) Oct 30, 2017
Makefile Add gRPC client handler. (#95) Nov 30, 2018
README.md fixed README on outdated method name Feb 5, 2018
appveyor.yml Add support for Go Modules (#92) Nov 21, 2018
bench_test.go refactored some http instrumentation code based on comments and added… Dec 22, 2017
circle.yml CircleCI: there's no golint installed, skip that test step Jun 30, 2018
context.go removed tracer context type & variable.. not implemented Dec 5, 2017
doc.go improved doc comment so zipkin site will be a link in godoc Jan 29, 2018
endpoint.go NewEndpoint fix: use empty ipv4 or ipv6 if applicable (fixes #85) (#86) Oct 30, 2018
endpoint_test.go NewEndpoint fix: use empty ipv4 or ipv6 if applicable (fixes #85) (#86) Oct 30, 2018
example_httpserver_test.go made required client parameter a functional option in http.NewClient() Feb 5, 2018
example_test.go added runnable examples in Godoc Jan 29, 2018
go.mod Add gRPC client handler. (#95) Nov 30, 2018
go.sum Add gRPC client handler. (#95) Nov 30, 2018
noop.go removed lingering details originating from span.Tracer() method logic Feb 5, 2018
noop_test.go [#68] Exposes alwaysSample and NeverSample to easier usage. Jul 11, 2018
sample.go Improves descriptions Jul 16, 2018
sample_test.go refactored some http instrumentation code based on comments and added… Dec 22, 2017
span.go removed span.Tracer() method Feb 5, 2018
span_implementation.go removed span.Tracer() method Feb 5, 2018
span_options.go Changed DelaySend to the more explicit FlushOnFinish Jan 3, 2018
span_test.go removed span.Tracer() method Feb 5, 2018
tags.go Adds missing tags Mar 9, 2018
tracer.go [#68] Exposes alwaysSample and NeverSample to easier usage. Jul 11, 2018
tracer_options.go various model fixes and improvements Dec 21, 2017
tracer_test.go default to noop implementation on nil reporter parameter Feb 5, 2018

README.md

Zipkin Library for Go

Travis CI CircleCI Appveyor CI Coverage Status Go Report Card GoDoc Gitter chat Sourcegraph

Zipkin Go is the official Go Tracer implementation for Zipkin, supported by the OpenZipkin community.

package organization

zipkin-go is built with interoperability in mind within the OpenZipkin community and even 3rd parties, the library consists of several packages.

The main tracing implementation can be found in the root folder of this repository. Reusable parts not considered core implementation or deemed beneficiary for usage by others are placed in their own packages within this repository.

model

This library implements the Zipkin V2 Span Model which is available in the model package. It contains a Go data model compatible with the Zipkin V2 API and can automatically sanitize, parse and (de)serialize to and from the required JSON representation as used by the official Zipkin V2 Collectors.

propagation

The propagation package and B3 subpackage hold the logic for propagating SpanContext (span identifiers and sampling flags) between services participating in traces. Currently Zipkin B3 Propagation is supported for HTTP and GRPC.

middleware

The middleware subpackages contain officially supported middleware handlers and tracing wrappers.

http

An easy to use http.Handler middleware for tracing server side requests is provided. This allows one to use this middleware in applications using standard library servers as well as most available higher level frameworks. Some frameworks will have their own instrumentation and middleware that maps better for their ecosystem.

For HTTP client operations NewTransport can return a http.RoundTripper implementation that can either wrap the standard http.Client's Transport or a custom provided one and add per request tracing. Since HTTP Requests can have one or multiple redirects it is advisable to always enclose HTTP Client calls with a Span either around the *http.Client call level or parent function level.

For convenience NewClient is provided which returns a HTTP Client which embeds *http.Client and provides an application span around the HTTP calls when calling the DoWithAppSpan() method.

grpc

gRPC middleware / interceptors are planned for the near future.

reporter

The reporter package holds the interface which the various Reporter implementations use. It is exported into its own package as it can be used by 3rd parties to use these Reporter packages in their own libraries for exporting to the Zipkin ecosystem. The zipkin-go tracer also uses the interface to accept 3rd party Reporter implementations.

HTTP Reporter

Most common Reporter type used by Zipkin users transporting Spans to the Zipkin server using JSON over HTTP. The reporter holds a buffer and reports to the backend asynchronously.

Kafka Reporter

High performance Reporter transporting Spans to the Zipkin server using a Kafka Producer digesting JSON V2 Spans. The reporter uses the Sarama async producer underneath.

usage and examples

HTTP Server Example