internal

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ComponentKey     = otelcore.Key("component")
	ServiceKey       = otelcore.Key("service")
	StatusCodeKey    = otelcore.Key("status.code")
	StatusMessageKey = otelcore.Key("status.message")
	ErrorKey         = otelcore.Key("error")
	NameKey          = otelcore.Key("name")
)

Functions

This section is empty.

Types

type MockContextKeyValue

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

type MockEvent

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

type MockSpan

type MockSpan struct {
	SpanKind oteltrace.SpanKind

	Attributes   otelcorrelation.Map
	StartTime    time.Time
	EndTime      time.Time
	ParentSpanID oteltrace.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) RecordError added in v0.2.3

func (s *MockSpan) RecordError(ctx context.Context, err error, opts ...oteltrace.ErrorOption)

func (*MockSpan) SetAttribute

func (s *MockSpan) SetAttribute(k string, v interface{})

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(code codes.Code, msg string)

func (*MockSpan) SpanContext

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

func (*MockSpan) Tracer

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

type MockTracer

type MockTracer struct {
	Resources             otelcorrelation.Map
	FinishedSpans         []*MockSpan
	SpareTraceIDs         []oteltrace.ID
	SpareSpanIDs          []oteltrace.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, opts ...oteltrace.StartOption) error

Jump to

Keyboard shortcuts

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