...
1# package tracing
2
3`package tracing` provides [Dapper]-style request tracing to services.
4
5## Rationale
6
7Request tracing is a fundamental building block for large distributed
8applications. It's instrumental in understanding request flows, identifying
9hot spots, and diagnosing errors. All microservice infrastructures will
10benefit from request tracing; sufficiently large infrastructures will require
11it.
12
13## Zipkin
14
15[Zipkin] is one of the most used OSS distributed tracing platforms available
16with support for many different languages and frameworks. Go kit provides
17bindings to the native Go tracing implementation [zipkin-go]. If using Zipkin
18with Go kit in a polyglot microservices environment, this is the preferred
19binding to use. Instrumentation exists for `kit/transport/http` and
20`kit/transport/grpc`. The bindings are highlighted in the [addsvc] example. For
21more information regarding Zipkin feel free to visit [Zipkin's Gitter].
22
23## OpenCensus
24
25Go kit supports transport and endpoint middlewares for the [OpenCensus]
26instrumentation library. OpenCensus provides a cross language consistent data
27model and instrumentation libraries for tracing and metrics. From this data
28model it allows exports to various tracing and metrics backends including but
29not limited to Zipkin, Prometheus, Stackdriver Trace & Monitoring, Jaeger,
30AWS X-Ray and Datadog. Go kit uses the [opencensus-go] implementation to power
31its middlewares.
32
33## OpenTracing
34
35Go kit supports the [OpenTracing] API and uses the [opentracing-go] package to
36provide tracing middlewares for its servers and clients. Currently OpenTracing
37instrumentation exists for `kit/transport/http` and `kit/transport/grpc`.
38
39Since [OpenTracing] is an effort to provide a generic API, Go kit should support
40a multitude of tracing backends. If a Tracer implementation or OpenTracing
41bridge in Go for your back-end exists, it should work out of the box.
42
43Please note that the "world view" of existing tracing systems do differ.
44OpenTracing can not guarantee you that tracing alignment is perfect in a
45microservice environment especially one which is not exclusively OpenTracing
46enabled or switching from one tracing backend to another truly entails just a
47change in configuration.
48
49The following tracing back-ends are known to work with Go kit through the
50OpenTracing interface and are highlighted in the [addsvc] example.
51
52### AppDash
53
54[Appdash] support is available straight from their system repository in the
55[appdash/opentracing] directory.
56
57### LightStep
58
59[LightStep] support is available through their standard Go package
60[lightstep-tracer-go].
61
62### Zipkin
63
64[Zipkin] support is available through the [zipkin-go-opentracing] package.
65
66## OpenTelemetry
67
68[OpenTelemetry] came to life as a result of merging [OpenCensus] and [OpenTracing].
69Go kit instrumentation can be found in [opentelemetry-go-contrib]
70which is a central repository of instrumentation libraries.
71
72[Dapper]: http://research.google.com/pubs/pub36356.html
73[addsvc]: https://github.com/go-kit/examples/tree/master/addsvc
74[README]: https://github.com/go-kit/kit/blob/master/tracing/zipkin/README.md
75
76[OpenTracing]: http://opentracing.io
77[opentracing-go]: https://github.com/opentracing/opentracing-go
78
79[Zipkin]: http://zipkin.io/
80[Open Zipkin GitHub]: https://github.com/openzipkin
81[zipkin-go-opentracing]: https://github.com/openzipkin-contrib/zipkin-go-opentracing
82[zipkin-go]: https://github.com/openzipkin/zipkin-go
83[Zipkin's Gitter]: https://gitter.im/openzipkin/zipkin
84
85[Appdash]: https://github.com/sourcegraph/appdash
86[appdash/opentracing]: https://github.com/sourcegraph/appdash/tree/master/opentracing
87
88[LightStep]: http://lightstep.com/
89[lightstep-tracer-go]: https://github.com/lightstep/lightstep-tracer-go
90
91[OpenCensus]: https://opencensus.io/
92[opencensus-go]: https://github.com/census-instrumentation/opencensus-go
93
94[OpenTelemetry]: https://opentelemetry.io/
95[opentelemetry-go-contrib]: https://github.com/open-telemetry/opentelemetry-go-contrib
View as plain text