Documentation ¶
Overview ¶
Package noop provides an implementation of the OpenTelemetry trace API that produces no telemetry and minimizes used computation resources.
Using this package to implement the OpenTelemetry trace API will effectively disable OpenTelemetry.
This implementation can be embedded in other implementations of the OpenTelemetry trace API. Doing so will mean the implementation defaults to no operation for methods it does not implement.
Index ¶
- type Span
- func (Span) AddEvent(string, ...trace.EventOption)
- func (Span) AddLink(trace.Link)
- func (Span) End(...trace.SpanEndOption)
- func (Span) IsRecording() bool
- func (Span) RecordError(error, ...trace.EventOption)
- func (Span) SetAttributes(...attribute.KeyValue)
- func (Span) SetName(string)
- func (Span) SetStatus(codes.Code, string)
- func (s Span) SpanContext() trace.SpanContext
- func (Span) TracerProvider() trace.TracerProvider
- type Tracer
- type TracerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Span ¶
Span is an OpenTelemetry No-Op Span.
func (Span) RecordError ¶
func (Span) RecordError(error, ...trace.EventOption)
RecordError does nothing.
func (Span) SetAttributes ¶
SetAttributes does nothing.
func (Span) SpanContext ¶
func (s Span) SpanContext() trace.SpanContext
SpanContext returns an empty span context.
func (Span) TracerProvider ¶
func (Span) TracerProvider() trace.TracerProvider
TracerProvider returns a No-Op TracerProvider.
type Tracer ¶
Tracer is an OpenTelemetry No-Op Tracer.
func (Tracer) Start ¶
func (t Tracer) Start(ctx context.Context, _ string, _ ...trace.SpanStartOption) (context.Context, trace.Span)
Start creates a span. The created span will be set in a child context of ctx and returned with the span.
If ctx contains a span context, the returned span will also contain that span context. If the span context in ctx is for a non-recording span, that span instance will be returned directly.
type TracerProvider ¶
type TracerProvider struct{ embedded.TracerProvider }
TracerProvider is an OpenTelemetry No-Op TracerProvider.
func NewTracerProvider ¶
func NewTracerProvider() TracerProvider
NewTracerProvider returns a TracerProvider that does not record any telemetry.
func (TracerProvider) Tracer ¶
func (TracerProvider) Tracer(string, ...trace.TracerOption) trace.Tracer
Tracer returns an OpenTelemetry Tracer that does not record any telemetry.