Skip to content

Commit

Permalink
rename func to remove init prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Jan 10, 2024
1 parent ef3a540 commit 555d28d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions config/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion config/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 555d28d

Please sign in to comment.