internal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ComponentKey = otelkey.New("component")
	ServiceKey   = otelkey.New("service")
	StatusKey    = otelkey.New("status")
	ErrorKey     = otelkey.New("error")
	NameKey      = otelkey.New("name")
)

Functions

This section is empty.

Types

type MockContextKeyValue

type MockContextKeyValue struct {
	Key   interface{}
	Value interface{}
}

type MockEvent

type MockEvent struct {
	CtxAttributes oteldctx.Map
	Timestamp     time.Time
	Name          string
	Attributes    oteldctx.Map
}

type MockSpan

type MockSpan struct {
	SpanKind oteltrace.SpanKind

	Attributes   oteldctx.Map
	StartTime    time.Time
	EndTime      time.Time
	ParentSpanID otelcore.SpanID
	Events       []MockEvent
	// contains filtered or unexported fields
}

func (*MockSpan) AddEvent

func (s *MockSpan) AddEvent(ctx context.Context, name string, attrs ...otelcore.KeyValue)

func (*MockSpan) AddEventWithTimestamp

func (s *MockSpan) AddEventWithTimestamp(ctx context.Context, timestamp time.Time, name string, attrs ...otelcore.KeyValue)

func (*MockSpan) End

func (s *MockSpan) End(options ...oteltrace.EndOption)

func (*MockSpan) IsRecording

func (s *MockSpan) IsRecording() bool

func (*MockSpan) OverrideTracer

func (s *MockSpan) OverrideTracer(tracer oteltrace.Tracer)

func (*MockSpan) SetAttributes

func (s *MockSpan) SetAttributes(attributes ...otelcore.KeyValue)

func (*MockSpan) SetError

func (s *MockSpan) SetError(v bool)

func (*MockSpan) SetName

func (s *MockSpan) SetName(name string)

func (*MockSpan) SetStatus

func (s *MockSpan) SetStatus(status codes.Code)

func (*MockSpan) SpanContext

func (s *MockSpan) SpanContext() otelcore.SpanContext

func (*MockSpan) Tracer

func (s *MockSpan) Tracer() oteltrace.Tracer

type MockTracer

type MockTracer struct {
	Resources             oteldctx.Map
	FinishedSpans         []*MockSpan
	SpareTraceIDs         []otelcore.TraceID
	SpareSpanIDs          []otelcore.SpanID
	SpareContextKeyValues []MockContextKeyValue
	// contains filtered or unexported fields
}

func NewMockTracer

func NewMockTracer() *MockTracer

func (*MockTracer) DeferredContextSetupHook

func (t *MockTracer) DeferredContextSetupHook(ctx context.Context, span oteltrace.Span) context.Context

func (*MockTracer) Start

func (*MockTracer) WithSpan

func (t *MockTracer) WithSpan(ctx context.Context, name string, body func(context.Context) error) error

Jump to

Keyboard shortcuts

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