From 8e376c84cf47b808595545f7ad099b6e78c5e280 Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Thu, 2 Dec 2021 05:44:59 -0800 Subject: [PATCH] feat(tracing): setup logging --- lib/tracing/setup.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tracing/setup.go b/lib/tracing/setup.go index 1a2d8128e..d90099f79 100644 --- a/lib/tracing/setup.go +++ b/lib/tracing/setup.go @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/otel/sdk/resource" tracesdk "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.7.0" + "go.uber.org/zap" logging "github.com/ipfs/go-log/v2" ) @@ -50,7 +51,7 @@ func jaegerOptsFromEnv() jaeger.EndpointOption { } if e, ok = os.LookupEnv(envAgentHost); ok { - options := []jaeger.AgentEndpointOption{jaeger.WithAgentHost(e)} + options := []jaeger.AgentEndpointOption{jaeger.WithAgentHost(e), jaeger.WithLogger(zap.NewStdLog(log.Desugar()))} var ep string if p, ok := os.LookupEnv(envAgentPort); ok { options = append(options, jaeger.WithAgentPort(p)) @@ -82,6 +83,7 @@ func SetupJaegerTracing(serviceName string) *tracesdk.TracerProvider { semconv.SchemaURL, semconv.ServiceNameKey.String(serviceName), )), + tracesdk.WithSampler(tracesdk.AlwaysSample()), ) otel.SetTracerProvider(tp) tracer := tp.Tracer(serviceName)