"github.com/uber/jaeger-client-go/zipkin" ) func InitTracing(serviceName string) (opentracing.Tracer, io.Closer) { zipkinPropagator := zipkin.NewZipkinB3HTTPHeaderPropagator() injector := jaeger.TracerOptions.Injector(opentracing.HTTPHeaders, zipkinPropagator) extractor := jaeger.TracerOptions.Extractor(opentracing.HTTPHeaders, zipkinPropagator) tracer, closer := jaeger.NewTracer( serviceName, jaeger.NewConstSampler(true), jaeger.NewNullReporter(), injector, extractor, ) opentracing.SetGlobalTracer(tracer) ... • 必要なヘッダー(x-b3-*)をextract, injectする為にzipkinPropagatrorを 使用 • JaegerはOpenTracingの実装なの でOpenTracing.Tracer Interfaceを 満たす • Tracerをアプリ内でシングルトンにす る為SetGlobalTracerする • Sampling Rateは固定 • Reporterもテスト用にNullReporter ◦ 詳しい説明はこちら