From 6053ddbc7361e7eab492d0433cd0a1bb3b3baf63 Mon Sep 17 00:00:00 2001 From: ww24 Date: Tue, 25 Oct 2022 12:06:20 +0900 Subject: [PATCH] fix: use Zipkin B3 propagator --- go.mod | 1 + go.sum | 2 ++ tracer/tracer.go | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 81897463..43e59901 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/tenntenn/testtime v0.2.2 go.opencensus.io v0.23.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 + go.opentelemetry.io/contrib/propagators/b3 v1.11.1 go.opentelemetry.io/otel v1.11.1 go.opentelemetry.io/otel/bridge/opencensus v0.33.0 go.opentelemetry.io/otel/sdk v1.11.1 diff --git a/go.sum b/go.sum index ac7527b7..56f7fbce 100644 --- a/go.sum +++ b/go.sum @@ -307,6 +307,8 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA= +go.opentelemetry.io/contrib/propagators/b3 v1.11.1 h1:icQ6ttRV+r/2fnU46BIo/g/mPu6Rs5Ug8Rtohe3KqzI= +go.opentelemetry.io/contrib/propagators/b3 v1.11.1/go.mod h1:ECIveyMXgnl4gorxFcA7RYjJY/Ql9n20ubhbfDc3QfA= go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/bridge/opencensus v0.33.0 h1:DnSFYr/VxUVwkHL0UoaMcxx74Jugb1HO0B08cYBmi0c= diff --git a/tracer/tracer.go b/tracer/tracer.go index 81368bfa..cadfe62e 100644 --- a/tracer/tracer.go +++ b/tracer/tracer.go @@ -7,6 +7,7 @@ import ( "github.com/GoogleCloudPlatform/opentelemetry-operations-go/propagator" octrace "go.opencensus.io/trace" + "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/bridge/opencensus" "go.opentelemetry.io/otel/propagation" @@ -63,9 +64,10 @@ func New(c *Config, conf repository.Config, exporter sdktrace.SpanExporter) (tra otel.SetTextMapPropagator( propagation.NewCompositeTextMapPropagator( + // propagation.TraceContext{}, + // propagation.Baggage{}, propagator.CloudTraceOneWayPropagator{}, - propagation.TraceContext{}, - propagation.Baggage{}, + b3.New(), ), )