Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(recorder SpanRecorder) ot.Tracer
New creates and returns a standard Tracer which defers completed Spans to `recorder`.
Types ¶
type InMemorySpanRecorder ¶
InMemorySpanRecorder stores spans using a slice in a thread-safe way
func NewInMemoryRecorder ¶
func NewInMemoryRecorder() *InMemorySpanRecorder
NewInMemoryRecorder creates new InMemorySpanRecorder
func (*InMemorySpanRecorder) GetSpans ¶
func (r *InMemorySpanRecorder) GetSpans() []*RawSpan
GetSpans returns a copy of the array of spans accumulated so far.
func (*InMemorySpanRecorder) RecordSpan ¶
func (r *InMemorySpanRecorder) RecordSpan(span *RawSpan)
RecordSpan implements the respective method of SpanRecorder.
func (*InMemorySpanRecorder) Reset ¶
func (r *InMemorySpanRecorder) Reset()
Reset clears the internal array of spans.
type RawSpan ¶
type RawSpan struct {
Context SpanContext
ParentSpanID string
OperationName string
StartTimestamp int64
EndTimestamp int64
DomainName string
ClassName string
Tags ot.Tags
Logs []ot.LogRecord
}
RawSpan encapsulates all state associated with a (finished) Span.
func GetRaw ¶
GetRaw casts opentracing span interface to spanImpl struct
func (*RawSpan) Duration ¶
Duration calculates the spans duration
type SpanContext ¶
type SpanContext struct {
TransactionID string
// A probabilistically unique identifier for a [multi-span] trace.
TraceID string
// A probabilistically unique identifier for a span.
SpanID string
// The span's associated baggage.
Baggage map[string]string
}
SpanContext holds the basic Span metadata.
func (SpanContext) ForeachBaggageItem ¶
func (c SpanContext) ForeachBaggageItem(handler func(k, v string) bool)
ForeachBaggageItem belongs to the opentracing.SpanContext interface
func (SpanContext) WithBaggageItem ¶
func (c SpanContext) WithBaggageItem(key, val string) SpanContext
WithBaggageItem returns an entirely new basictracer SpanContext with the given key:value baggage pair set.
Source Files
¶
- raw_span.go
- recorder.go
- span.go
- span_context.go
- tracer.go