otel: go.opentelemetry.io/otel/sdk/export/trace/tracetest Index | Files

package tracetest

import "go.opentelemetry.io/otel/sdk/export/trace/tracetest"

tracetest is a testing helper package for the SDK. User can configure no-op or in-memory exporters to verify different SDK behaviors or custom instrumentation.

Index

Package Files

test.go

type InMemoryExporter Uses

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

InMemoryExporter is an exporter that stores all received spans in-memory.

func NewInMemoryExporter Uses

func NewInMemoryExporter() *InMemoryExporter

NewInMemoryExporter returns a new InMemoryExporter.

func (*InMemoryExporter) ExportSpans Uses

func (imsb *InMemoryExporter) ExportSpans(_ context.Context, sds []*trace.SpanData) error

ExportSpans handles export of SpanData by storing it in memory.

func (*InMemoryExporter) GetSpans Uses

func (imsb *InMemoryExporter) GetSpans() []*trace.SpanData

GetSpans returns the current in-memory stored spans.

func (*InMemoryExporter) Reset Uses

func (imsb *InMemoryExporter) Reset()

Reset the current in-memory storage.

func (*InMemoryExporter) Shutdown Uses

func (imsb *InMemoryExporter) Shutdown(context.Context) error

Shutdown stops the exporter by clearing SpanData held in memory.

type NoopExporter Uses

type NoopExporter struct{}

NoopExporter is an exporter that drops all received SpanData and performs no action.

func NewNoopExporter Uses

func NewNoopExporter() *NoopExporter

NewNoopExporter returns a new no-op exporter.

func (*NoopExporter) ExportSpans Uses

func (nsb *NoopExporter) ExportSpans(context.Context, []*trace.SpanData) error

ExportSpans handles export of SpanData by dropping it.

func (*NoopExporter) Shutdown Uses

func (nsb *NoopExporter) Shutdown(context.Context) error

Shutdown stops the exporter by doing nothing.

Package tracetest imports 3 packages (graph). Updated 2020-10-12. Refresh now. Tools for package owners.