tracing

package
v1.41.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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StartOption

type StartOption func(*startOptions)

StartOption is an option for Start.

func WithAttributes

func WithAttributes(attributes ...attribute.KeyValue) StartOption

WithAttributes adds the given attributes.

func WithErr

func WithErr(errAddr *error) StartOption

WithErr will result in the given error being recorded on span.End() if the error is not nil, and the status being set to error.

func WithSpanName

func WithSpanName(spanName string) StartOption

WithSpanName sets the span name.

The default is to use the calling function name.

func WithSpanNameSuffix

func WithSpanNameSuffix(spanNameSuffix string) StartOption

WithSpanNameSuffix sets the span name suffix.

No no span name is set with WithSpanName, this adds the suffix to the default span name of the calling function name.

The default is to use the calling function name.

type Tracer

type Tracer interface {
	// Start creates a span.
	Start(ctx context.Context, options ...StartOption) (context.Context, trace.Span)
}

Tracer wraps an otel trace.Tracer.

var NopTracer Tracer = NewTracer(noop.Tracer{})

NopTracer is a no-op tracer.

func NewTracer

func NewTracer(otelTracer trace.Tracer) Tracer

NewTracer returns a new Tracer.

Jump to

Keyboard shortcuts

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