# 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).
没有合适的资源?快使用搜索试试~ 我知道了~
zipkin-go-opentracing, 在Go中,OpenTracing跟踪器的Zipkin实现.zip
共19个文件
go:10个
yml:4个
makefile:1个
需积分: 50 2 下载量 58 浏览量
2019-09-17
22:50:47
上传
评论
收藏 22KB ZIP 举报
温馨提示
zipkin-go-opentracing, 在Go中,OpenTracing跟踪器的Zipkin实现 zipkin-go-opentracing OpenTracing 跟踪实现中的 Zipkin跟踪。注释这个包是一个低级跟踪"驱动程序",允许 OpenTracing API消费者使用Zipkin作为他们的跟踪后
资源推荐
资源详情
资源评论
收起资源包目录
zipkin-go-opentracing.zip (19个子文件)
zipkin-go-opentracing-master
span_test.go 2KB
README.md 3KB
appveyor.yml 389B
tracer.go 4KB
span.go 3KB
LICENSE 10KB
bench_test.go 4KB
propagation_test.go 14KB
go.mod 369B
.golangci.yml 404B
tracer_options.go 1KB
recorder_test.go 263B
context.go 303B
go.sum 7KB
.travis.yml 567B
Makefile 333B
propagation.go 4KB
tracer_test.go 3KB
circle.yml 267B
共 19 条
- 1
资源评论
weixin_38743481
- 粉丝: 698
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功