diff --git a/sdk/trace/tracer.go b/sdk/trace/tracer.go index b0c0e6ef361..7b11fc465c6 100644 --- a/sdk/trace/tracer.go +++ b/sdk/trace/tracer.go @@ -37,8 +37,8 @@ var _ trace.Tracer = &tracer{} func (tr *tracer) Start(ctx context.Context, name string, options ...trace.SpanStartOption) (context.Context, trace.Span) { config := trace.NewSpanStartConfig(options...) - // If ctx is nil, set to context.Background() as context.WithValue will panic on a nil value. if ctx == nil { + // Prevent trace.ContextWithSpan from panicking. ctx = context.Background() }