noop

package
v1.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 173

README

Trace Noop

PkgGoDev

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Span

type Span struct {
	embedded.Span
	// contains filtered or unexported fields
}

Span is an OpenTelemetry No-Op Span.

func (Span) AddEvent

func (Span) AddEvent(string, ...trace.EventOption)

AddEvent does nothing.

func (Span) AddLink(trace.Link)

AddLink does nothing.

func (Span) End

func (Span) End(...trace.SpanEndOption)

End does nothing.

func (Span) IsRecording

func (Span) IsRecording() bool

IsRecording always returns false.

func (Span) RecordError

func (Span) RecordError(error, ...trace.EventOption)

RecordError does nothing.

func (Span) SetAttributes

func (Span) SetAttributes(...attribute.KeyValue)

SetAttributes does nothing.

func (Span) SetName

func (Span) SetName(string)

SetName does nothing.

func (Span) SetStatus

func (Span) SetStatus(codes.Code, string)

SetStatus 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

type Tracer struct{ embedded.Tracer }

Tracer is an OpenTelemetry No-Op Tracer.

func (Tracer) Start

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

Tracer returns an OpenTelemetry Tracer that does not record any telemetry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL