zipkin-go-opentracing

OpenTracing Tracer implementation for Zipkin v1 in Go

Github星跟蹤圖

zipkin-go-opentracing

Travis CI
GoDoc
Go Report Card
Sourcegraph

OpenTracing bridge for the native Zipkin tracing implementation 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.

For developers interested in adding Zipkin tracing to their Go services we
suggest looking at Go kit 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 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.

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.

主要指標

概覽
名稱與所有者openzipkin-contrib/zipkin-go-opentracing
主編程語言Go
編程語言Go (語言數: 2)
平台
許可證Apache License 2.0
所有者活动
創建於2016-05-14 13:34:57
推送於2022-10-11 19:02:56
最后一次提交2022-10-11 21:01:14
發布數19
最新版本名稱v0.5.0 (發布於 )
第一版名稱v0.1.0 (發布於 )
用户参与
星數509
關注者數25
派生數98
提交數237
已啟用問題?
問題數63
打開的問題數1
拉請求數80
打開的拉請求數1
關閉的拉請求數18
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?