tracing

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Key   string
	Value any
}

Attribute is a key-value pair for span metadata.

type Span

type Span interface {
	End()
	SetAttributes(kv ...Attribute)
	RecordError(err error)
}

Span represents a tracing span that can be ended and annotated.

func StartSpan

func StartSpan(ctx context.Context, tracer Tracer, name string) (context.Context, Span)

StartSpan starts a span from the given tracer, falling back to Noop.

type Tracer

type Tracer interface {
	StartSpan(ctx context.Context, name string) (context.Context, Span)
}

Tracer creates new spans.

var Noop Tracer = noopTracer{}

Noop is a Tracer that creates noop spans.

Jump to

Keyboard shortcuts

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