otlptracetest

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunEndToEndTest

func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlptrace.Exporter, tracesCollector TracesCollector)

RunEndToEndTest can be used by otlptrace.Client tests to validate themselves.

func RunExporterShutdownTest

func RunExporterShutdownTest(t *testing.T, factory func() otlptrace.Client)

func SingleReadOnlySpan

func SingleReadOnlySpan() []tracesdk.ReadOnlySpan

SingleReadOnlySpan returns a one-element slice with a read-only span. It may be useful for testing driver's trace export.

Types

type SpansStorage

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

SpansStorage stores the spans. Mock collectors can use it to store spans they have received.

func NewSpansStorage

func NewSpansStorage() SpansStorage

NewSpansStorage creates a new spans storage.

func (*SpansStorage) AddSpans

AddSpans adds spans to the spans storage.

func (*SpansStorage) GetResourceSpans

func (s *SpansStorage) GetResourceSpans() []*tracepb.ResourceSpans

GetResourceSpans returns the stored resource spans.

func (*SpansStorage) GetSpans

func (s *SpansStorage) GetSpans() []*tracepb.Span

GetSpans returns the stored spans.

type TracesCollector

type TracesCollector interface {
	Stop() error
	GetResourceSpans() []*tracepb.ResourceSpans
}

TracesCollector mocks a collector for the end-to-end testing.

Jump to

Keyboard shortcuts

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