Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openzipkin-contrib/zipkin-go-opentracing
OpenTracing Bridge for Zipkin Go
https://github.com/openzipkin-contrib/zipkin-go-opentracing
distributed-tracing go instrumentation opentracing openzipkin trace tracing zipkin
Last synced: about 1 month ago
JSON representation
OpenTracing Bridge for Zipkin Go
- Host: GitHub
- URL: https://github.com/openzipkin-contrib/zipkin-go-opentracing
- Owner: openzipkin-contrib
- License: apache-2.0
- Created: 2016-05-14T13:34:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-10-11T19:02:56.000Z (about 2 years ago)
- Last Synced: 2024-10-29T19:59:19.252Z (about 1 month ago)
- Topics: distributed-tracing, go, instrumentation, opentracing, openzipkin, trace, tracing, zipkin
- Language: Go
- Homepage:
- Size: 330 KB
- Stars: 510
- Watchers: 26
- Forks: 100
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome - openzipkin-contrib/zipkin-go-opentracing - tracing,go,instrumentation,opentracing,openzipkin,trace,tracing,zipkin pushed_at:2022-10 star:0.5k fork:0.1k OpenTracing Bridge for Zipkin Go (Go)
README
# zipkin-go-opentracing
[![Travis CI](https://travis-ci.org/openzipkin-contrib/zipkin-go-opentracing.svg?branch=master)](https://travis-ci.org/openzipkin-contrib/zipkin-go-opentracing)
[![GoDoc](https://godoc.org/github.com/openzipkin-contrib/zipkin-go-opentracing?status.svg)](https://godoc.org/github.com/openzipkin-contrib/zipkin-go-opentracing)
[![Go Report Card](https://goreportcard.com/badge/github.com/openzipkin-contrib/zipkin-go-opentracing)](https://goreportcard.com/report/github.com/openzipkin-contrib/zipkin-go-opentracing)
[![Sourcegraph](https://sourcegraph.com/github.com/openzipkin-contrib/zipkin-go-opentracing/-/badge.svg)](https://sourcegraph.com/github.com/openzipkin-contrib/zipkin-go-opentracing?badge)[OpenTracing](http://opentracing.io) bridge for the native [Zipkin](https://zipkin.io) tracing implementation [Zipkin Go](https://github.com/openzipkin/zipkin-go).
### Notes
This package is a simple bridge to allow OpenTracing API consumers
to use Zipkin as their tracing backend. For details on how to work with spans
and traces we suggest looking at the documentation and README from the
[OpenTracing API](https://github.com/opentracing/opentracing-go).For developers interested in adding Zipkin tracing to their Go services we
suggest looking at [Go kit](https://gokit.io) which is an excellent toolkit to
instrument your distributed system with Zipkin and much more with clean
separation of domains like transport, middleware / instrumentation and
business logic.### Examples
Please check the [zipkin-go](https://github.com/openzipkin/zipkin-go) package for information how to set-up the Zipkin Go native tracer. Once set-up you can simple call the `Wrap` function to create the OpenTracing compatible bridge.
```go
import (
"github.com/opentracing/opentracing-go"
"github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zipkin-go/reporter/http"
zipkinot "github.com/openzipkin-contrib/zipkin-go-opentracing"
)func main() {
// bootstrap your app...
// zipkin / opentracing specific stuff
{
// set up a span reporter
reporter := zipkinhttp.NewReporter("http://zipkinhost:9411/api/v2/spans")
defer reporter.Close()
// create our local service endpoint
endpoint, err := zipkin.NewEndpoint("myService", "myservice.mydomain.com:80")
if err != nil {
log.Fatalf("unable to create local endpoint: %+v\n", err)
}// initialize our tracer
nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(endpoint))
if err != nil {
log.Fatalf("unable to create tracer: %+v\n", err)
}// use zipkin-go-opentracing to wrap our tracer
tracer := zipkinot.Wrap(nativeTracer)
// optionally set as Global OpenTracing tracer instance
opentracing.SetGlobalTracer(tracer)
}
// do other bootstrapping stuff...
}
```For more information on zipkin-go-opentracing, please see the documentation at
[go doc](https://godoc.org/github.com/openzipkin-contrib/zipkin-go-opentracing).