diff --git a/exporters/autoexport/exporter.go b/exporters/autoexport/exporter.go index eba67b1bc36..c7fbcfcac62 100644 --- a/exporters/autoexport/exporter.go +++ b/exporters/autoexport/exporter.go @@ -87,7 +87,7 @@ func WithFallbackSpanExporter(exporter trace.SpanExporter) Option { // Use [WithFallbackSpanExporter] option to change the returned exporter // when OTEL_TRACES_EXPORTER is unset or empty. // -// Use [IsNone] to check if the retured exporter is a "no operation" exporter. +// Use [IsNoneSpanExporter] to check if the retured exporter is a "no operation" exporter. func NewSpanExporter(ctx context.Context, opts ...Option) (trace.SpanExporter, error) { // prefer exporter configured via environment variables over exporter // passed in via exporter parameter diff --git a/exporters/autoexport/exporter_test.go b/exporters/autoexport/exporter_test.go index a8a2ce66871..1e39d363d6e 100644 --- a/exporters/autoexport/exporter_test.go +++ b/exporters/autoexport/exporter_test.go @@ -39,7 +39,7 @@ func TestFallbackExporterReturnedWhenNoEnvExporterConfigured(t *testing.T) { ) assert.NoError(t, err) assert.Equal(t, testExporter, exporter) - assert.False(t, IsNone(exporter)) + assert.False(t, IsNoneSpanExporter(exporter)) } func TestEnvExporterIsPreferredOverFallbackExporter(t *testing.T) { @@ -94,7 +94,7 @@ func TestEnvExporterNone(t *testing.T) { exporter, err := NewSpanExporter(context.Background()) assert.NoError(t, err) - assert.True(t, IsNone(exporter)) + assert.True(t, IsNoneSpanExporter(exporter)) } func assertOTLPHTTPExporter(t *testing.T, got trace.SpanExporter) { @@ -108,7 +108,7 @@ func assertOTLPHTTPExporter(t *testing.T, got trace.SpanExporter) { clientType := reflect.Indirect(reflect.ValueOf(got)).FieldByName("client").Elem().Type().String() assert.Equal(t, "*otlptracehttp.client", clientType) - assert.False(t, IsNone(got)) + assert.False(t, IsNoneSpanExporter(got)) } func assertOTLPGRPCExporter(t *testing.T, got trace.SpanExporter) { @@ -122,7 +122,7 @@ func assertOTLPGRPCExporter(t *testing.T, got trace.SpanExporter) { clientType := reflect.Indirect(reflect.ValueOf(got)).FieldByName("client").Elem().Type().String() assert.Equal(t, "*otlptracegrpc.client", clientType) - assert.False(t, IsNone(got)) + assert.False(t, IsNoneSpanExporter(got)) } type testExporter struct{} diff --git a/exporters/autoexport/noop.go b/exporters/autoexport/noop.go index 15b9646767c..95797692a01 100644 --- a/exporters/autoexport/noop.go +++ b/exporters/autoexport/noop.go @@ -35,9 +35,9 @@ func (e noop) Shutdown(ctx context.Context) error { return nil } -// IsNone returns true for the exporter returned by [NewSpanExporter] +// IsNoneSpanExporter returns true for the exporter returned by [NewSpanExporter] // when OTEL_TRACES_EXPORTER environment variable is set to "none". -func IsNone(e trace.SpanExporter) bool { +func IsNoneSpanExporter(e trace.SpanExporter) bool { _, ok := e.(noop) return ok }