diff --git a/pkg/tracing/setup.go b/pkg/tracing/setup.go index 3df069ee..067dfda8 100644 --- a/pkg/tracing/setup.go +++ b/pkg/tracing/setup.go @@ -99,8 +99,8 @@ func Shutdown(ctx context.Context) error { return flushAndShutdown(ctx) } -func getDefaultTracer() *atomic.Value { - v := &atomic.Value{} +func getDefaultTracer() *atomic.Pointer[tracerHolder] { + v := new(atomic.Pointer[tracerHolder]) v.Store(&tracerHolder{Tracer: trace.NewNoopTracerProvider().Tracer("")}) return v } diff --git a/pkg/tracing/span.go b/pkg/tracing/span.go index 5e28c750..1071f476 100644 --- a/pkg/tracing/span.go +++ b/pkg/tracing/span.go @@ -8,5 +8,5 @@ import ( // StartSpanFromContext creates a span and a context.Context containing the newly-created span. func StartSpanFromContext(ctx context.Context, operationName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { - return tracer.Load().(*tracerHolder).Tracer.Start(ctx, operationName, opts...) + return tracer.Load().Tracer.Start(ctx, operationName, opts...) }