tracetesting

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTracer

func InitTracer() (apitrace.Tracer, func() []sdktrace.ReadOnlySpan)

InitTracer initializes the tracer and returns a flusher of the reported spans for further inspection. Its main purpose is to declare a tracer for TESTING.

Types

type LookupAttributes

type LookupAttributes []attribute.KeyValue

LookupAttributes allows to lookup an attribute by key. This is useful for testing purposes.

func (LookupAttributes) Get

Get returns the value of an attribute by key or returns an empty one if it can't find it.

func (LookupAttributes) Has

func (a LookupAttributes) Has(key string) bool

Has returns true if it can find the attribute by key otherwise false

type Recorder added in v0.5.0

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

Recorder records spans being synced through the SpanSyncer interface.

func NewRecorder added in v0.5.0

func NewRecorder() *Recorder

func (*Recorder) ExportSpans added in v0.5.0

func (r *Recorder) ExportSpans(_ context.Context, s []trace.ReadOnlySpan) error

ExportSpans records spans into the internal buffer

func (*Recorder) Flush added in v0.5.0

func (r *Recorder) Flush() []trace.ReadOnlySpan

Flush returns the current recorded spans and reset the recordings

func (*Recorder) Shutdown added in v0.5.0

func (r *Recorder) Shutdown(_ context.Context) error

Shutdown flushes the buffer

Jump to

Keyboard shortcuts

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