diff --git a/config/config.go b/config/config.go index be8be3d8d6a..d8c344a783f 100644 --- a/config/config.go +++ b/config/config.go @@ -69,7 +69,7 @@ func NewSDK(opts ...ConfigurationOption) (SDK, error) { } mp, mpShutdown := initMeterProvider(o) - tp, tpShutdown, err := initTracerProvider(o, r) + tp, tpShutdown, err := tracerProvider(o, r) if err != nil { return SDK{}, err } diff --git a/config/trace.go b/config/trace.go index d0c154d7e4c..b95050aff6f 100644 --- a/config/trace.go +++ b/config/trace.go @@ -21,7 +21,7 @@ import ( var errNoValidSpanExporter = errors.New("no valid span exporter") -func initTracerProvider(cfg configOptions, res *resource.Resource) (trace.TracerProvider, shutdownFunc, error) { +func tracerProvider(cfg configOptions, res *resource.Resource) (trace.TracerProvider, shutdownFunc, error) { if cfg.opentelemetryConfig.TracerProvider == nil { return noop.NewTracerProvider(), noopShutdown, nil } @@ -48,9 +48,9 @@ func spanExporter(ctx context.Context, exporter SpanExporter) (sdktrace.SpanExpo if exporter.OTLP != nil { switch exporter.OTLP.Protocol { case protocolProtobufHTTP: - return initOTLPHTTPSpanExporter(ctx, exporter.OTLP) + return otlpHTTPSpanExporter(ctx, exporter.OTLP) case protocolProtobufGRPC: - return initOTLPgRPCSpanExporter(ctx, exporter.OTLP) + return otlpgRPCSpanExporter(ctx, exporter.OTLP) default: return nil, fmt.Errorf("unsupported protocol %q", exporter.OTLP.Protocol) } @@ -76,7 +76,7 @@ func spanProcessor(ctx context.Context, processor SpanProcessor) (sdktrace.SpanP return nil, fmt.Errorf("unsupported span processor type %v", processor) } -func initOTLPgRPCSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.SpanExporter, error) { +func otlpgRPCSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.SpanExporter, error) { opts := []otlptracegrpc.Option{} if len(otlpConfig.Endpoint) > 0 { @@ -110,7 +110,7 @@ func initOTLPgRPCSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.S return otlptracegrpc.New(ctx, opts...) } -func initOTLPHTTPSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.SpanExporter, error) { +func otlpHTTPSpanExporter(ctx context.Context, otlpConfig *OTLP) (sdktrace.SpanExporter, error) { opts := []otlptracehttp.Option{} if len(otlpConfig.Endpoint) > 0 { diff --git a/config/trace_test.go b/config/trace_test.go index 164357496ea..3ea1eed78cd 100644 --- a/config/trace_test.go +++ b/config/trace_test.go @@ -35,7 +35,7 @@ func TestInitTracerPovider(t *testing.T) { }, } for _, tt := range tests { - tp, shutdown, err := initTracerProvider(tt.cfg, resource.Default()) + tp, shutdown, err := tracerProvider(tt.cfg, resource.Default()) require.Equal(t, tt.wantProvider, tp) require.NoError(t, tt.wantErr, err) require.NoError(t, shutdown(context.Background()))