kubernetes/vendor/go.opentelemetry.io/otel/trace/noop.go

// NewNoopTracerProvider returns an implementation of TracerProvider that
// performs no operations. The Tracer and Spans created from the returned
// TracerProvider also perform no operations.
//
// Deprecated: Use [go.opentelemetry.io/otel/trace/noop.NewTracerProvider]
// instead.
func NewNoopTracerProvider() TracerProvider {}

type noopTracerProvider

var _

// Tracer returns noop implementation of Tracer.
func (p noopTracerProvider) Tracer(string, ...TracerOption) Tracer {}

type noopTracer

var _

// Start carries forward a non-recording Span, if one is present in the context, otherwise it
// creates a no-op Span.
func (t noopTracer) Start(ctx context.Context, name string, _ ...SpanStartOption) (context.Context, Span) {}

type noopSpan

var noopSpanInstance

// SpanContext returns an empty span context.
func (noopSpan) SpanContext() SpanContext {}

// IsRecording always returns false.
func (noopSpan) IsRecording() bool {}

// SetStatus does nothing.
func (noopSpan) SetStatus(codes.Code, string) {}

// SetError does nothing.
func (noopSpan) SetError(bool) {}

// SetAttributes does nothing.
func (noopSpan) SetAttributes(...attribute.KeyValue) {}

// End does nothing.
func (noopSpan) End(...SpanEndOption) {}

// RecordError does nothing.
func (noopSpan) RecordError(error, ...EventOption) {}

// AddEvent does nothing.
func (noopSpan) AddEvent(string, ...EventOption) {}

// AddLink does nothing.
func (noopSpan) AddLink(Link) {}

// SetName does nothing.
func (noopSpan) SetName(string) {}

// TracerProvider returns a no-op TracerProvider.
func (noopSpan) TracerProvider() TracerProvider {}