Skip to content

Instantly share code, notes, and snippets.

@rosspatil
Last active August 23, 2020 05:48
Show Gist options
  • Save rosspatil/eda9b733da384d29dedca92bc7871181 to your computer and use it in GitHub Desktop.
Save rosspatil/eda9b733da384d29dedca92bc7871181 to your computer and use it in GitHub Desktop.
Employee-opencensus-init
zipkinHTTPEndpoint := "http://localhost:9411/api/v2/spans"
reporter := httpReporter.NewReporter(zipkinHTTPEndpoint)
ze, err := zipkin.NewEndpoint("employee-service", "localhost:8080")
if err != nil {
log.Fatalln(err)
}
nativeTracer, err := zipkin.NewTracer(reporter, zipkin.WithLocalEndpoint(ze))
if err != nil {
log.Fatalln(err)
}
tracer := zipkinot.Wrap(nativeTracer)
opentracing.SetGlobalTracer(tracer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment