tracing

package
v0.248.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTracer

func DefaultTracer() trace.Tracer

DefaultTracer returns the default tracer that has been set with InitDefaultTracer. If InitDefaultTracer has never been called, the returned default tracer is an OTEL tracer with its name set to a generic name (`defaultTracerName`)

func Error added in v0.240.0

func Error(span trace.Span, err error) error

Error sets the status to error and record the error as an exception in the provided span.

func Errorf added in v0.240.0

func Errorf(span trace.Span, format string, args ...any) error

Errorf wraps fmt.Errorf and also sets the status to error and record the error as an exception in the provided span.

func InitDefaultTracer

func InitDefaultTracer(tracer trace.Tracer)

InitDefaultTracer sets the default tracer to the specified value. This method should only be called once during the plugin's initialization, and it's not safe for concurrent use.

func TraceIDFromContext added in v0.239.0

func TraceIDFromContext(ctx context.Context, requireSampled bool) string

Types

type Opts

type Opts struct {
	// CustomAttributes contains custom key value attributes used for the default OpenTelemetry trace provider.
	CustomAttributes []attribute.KeyValue
}

Opts contains settings for the trace provider and tracer setup that can be configured by the plugin developer.

Jump to

Keyboard shortcuts

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