Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type MockContextKeyValue

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

type MockEvent

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

type MockSpan

type MockSpan struct {
	SpanKind trace.SpanKind

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

func (*MockSpan) AddEvent

func (s *MockSpan) AddEvent(name string, o ...trace.EventOption)

func (*MockSpan) End

func (s *MockSpan) End(options ...trace.SpanOption)

func (*MockSpan) IsRecording

func (s *MockSpan) IsRecording() bool

func (*MockSpan) OverrideTracer

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

func (*MockSpan) RecordError

func (s *MockSpan) RecordError(err error, opts ...trace.EventOption)

func (*MockSpan) SetAttributes

func (s *MockSpan) SetAttributes(attributes ...attribute.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() trace.SpanContext

func (*MockSpan) Tracer

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

type MockTracer

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

func NewMockTracer

func NewMockTracer() *MockTracer

func (*MockTracer) DeferredContextSetupHook

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

func (*MockTracer) Start

func (t *MockTracer) Start(ctx context.Context, name string, opts ...trace.SpanOption) (context.Context, trace.Span)

Source Files