Help us shape the future of Go! Take the 2026 Go Developer Survey

tracing

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSpan

func FindSpan(spans []sdktrace.ReadOnlySpan, name string) sdktrace.ReadOnlySpan

func HasAttr

func HasAttr(s sdktrace.ReadOnlySpan, key string) bool

func SpanAttr

func SpanAttr(s sdktrace.ReadOnlySpan, key string) string

Types

type RecordingExporter

type RecordingExporter struct {
	// contains filtered or unexported fields
}

RecordingExporter collects exported spans for test assertions.

func SetupTracer

func SetupTracer(t *testing.T) *RecordingExporter

SetupTracer installs a test TracerProvider that records spans into the returned exporter. The global provider is reset to noop on test cleanup.

func (*RecordingExporter) ExportSpans

func (e *RecordingExporter) ExportSpans(_ context.Context, spans []sdktrace.ReadOnlySpan) error

func (*RecordingExporter) GetSpans

func (e *RecordingExporter) GetSpans() []sdktrace.ReadOnlySpan

func (*RecordingExporter) Shutdown

func (e *RecordingExporter) Shutdown(_ context.Context) error

Jump to

Keyboard shortcuts

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