Slide 37
Slide 37 text
A single configuration change to bind a Tracer
implementation in main() or similar
import "github.com/opentracing/opentracing-go"
import "github.com/tracer_x/tracerimpl"
func main() {
// Bind tracerimpl to the opentracing system
opentracing.InitGlobalTracer(
tracerimpl.New(kTracerImplAccessToken))
... normal main() stuff ...
}
How does it work?
Clean, vendor-neutral instrumentation code that
naturally tells the story of a distributed operation
import "github.com/opentracing/opentracing-go"
func AddContact(c *Contact) {
sp := opentracing.StartTrace("AddContact")
defer sp.Finish()
sp.Info("Added contact: ", *c)
subRoutine(sp, ...)
...
}
func subRoutine(parentSpan opentracing.Span, ...) {
...
sp := opentracing.JoinTrace("subRoutine", parentSpan)
defer sp.Finish()
sp.Info("deferred work to subroutine")
...
}
Thanks, @el_bhs
for the slide!