diff --git a/bridge/opentracing/wrapper.go b/bridge/opentracing/wrapper.go index 5f10819809f..bac427f1bbc 100644 --- a/bridge/opentracing/wrapper.go +++ b/bridge/opentracing/wrapper.go @@ -30,11 +30,13 @@ type WrapperTracerProvider struct { var _ trace.TracerProvider = (*WrapperTracerProvider)(nil) -// Tracer returns the WrapperTracer associated with the WrapperTracerProvider. +// Tracer creates a WrapperTracer associated with the WrapperTracerProvider. func (p *WrapperTracerProvider) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { return p.getWrappedTracer(name, opts...) } +// Deprecated: Use NewTracerProvider(...) instead. +// // NewWrappedTracerProvider creates a new trace provider that creates a single // instance of WrapperTracer that wraps OpenTelemetry tracer, and always returns // it unmodified from Tracer(). @@ -52,9 +54,9 @@ type wrappedTracerKey struct { version string } -// NewDynamicWrappedTracerProvider creates a new trace provider that creates new -// instances of WrapperTracer that wraps OpenTelemetry tracer for each call to Tracer(). -func NewDynamicWrappedTracerProvider(bridge *BridgeTracer, provider trace.TracerProvider) *WrapperTracerProvider { +// NewTracerProvider creates a new trace provider that creates new instances of +// WrapperTracer that wraps OpenTelemetry tracer for each call to Tracer(). +func NewTracerProvider(bridge *BridgeTracer, provider trace.TracerProvider) *WrapperTracerProvider { var ( mtx sync.Mutex tracers = make(map[wrappedTracerKey]*WrapperTracer) diff --git a/bridge/opentracing/wrapper_test.go b/bridge/opentracing/wrapper_test.go index f98277fc2e2..be1c760af33 100644 --- a/bridge/opentracing/wrapper_test.go +++ b/bridge/opentracing/wrapper_test.go @@ -24,7 +24,7 @@ func (p *namedMockTracerProvider) Tracer(name string, opts ...trace.TracerOption } } -func TestDynamicWrappedTracerProvider(t *testing.T) { +func TestTracerProvider(t *testing.T) { // assertMockTracerName casts tracer into a named mock tracer provided by // namedMockTracerProvider, and asserts against its name assertMockTracerName := func(t *testing.T, tracer trace.Tracer, name string) { @@ -45,7 +45,7 @@ func TestDynamicWrappedTracerProvider(t *testing.T) { var ( foobar = "foobar" bazbar = "bazbar" - provider = NewDynamicWrappedTracerProvider(nil, &namedMockTracerProvider{}) + provider = NewTracerProvider(nil, &namedMockTracerProvider{}) ) t.Run("Tracers should be created with foobar from provider", func(t *testing.T) {