tracing

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 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