Documentation ¶
Index ¶
- Variables
- func ClearSpanListeners()
- func New(recorder SpanRecorder) ot.Tracer
- func OnSpanStarted(ots ot.Span)
- func ParseSpanListeners()
- func RegisterSpanListener(listener ThundraSpanListener)
- type CompositeSpanFilter
- type ErrorInjectorSpanListener
- type FilteringSpanListener
- type InMemorySpanRecorder
- type LatencyInjectorSpanListener
- type Operation
- type RawSpan
- type SecurityAwareSpanListener
- type SpanContext
- type SpanFilter
- type SpanFilterer
- type SpanRecorder
- type TagInjectorSpanListener
- type ThundraSpanFilter
- type ThundraSpanFilterer
- type ThundraSpanListener
- func GetSpanListeners() []ThundraSpanListener
- func NewErrorInjectorSpanListener(config map[string]interface{}) ThundraSpanListener
- func NewFilteringSpanListener(config map[string]interface{}) ThundraSpanListener
- func NewLatencyInjectorSpanListener(config map[string]interface{}) ThundraSpanListener
- func NewSecurityAwareSpanListener(config map[string]interface{}) ThundraSpanListener
- func NewTagInjectorSpanListener(config map[string]interface{}) ThundraSpanListener
Constants ¶
This section is empty.
Variables ¶
var SpanListenerConstructorMap = make(map[string]func(map[string]interface{}) ThundraSpanListener, 0)
Functions ¶
func ClearSpanListeners ¶
func ClearSpanListeners()
func New ¶
func New(recorder SpanRecorder) ot.Tracer
New creates and returns a standard Tracer which defers completed Spans to `recorder`.
func OnSpanStarted ¶
func ParseSpanListeners ¶
func ParseSpanListeners()
func RegisterSpanListener ¶
func RegisterSpanListener(listener ThundraSpanListener)
Types ¶
type CompositeSpanFilter ¶
type CompositeSpanFilter struct {
// contains filtered or unexported fields
}
func (*CompositeSpanFilter) Accept ¶
func (f *CompositeSpanFilter) Accept(span *spanImpl) bool
type ErrorInjectorSpanListener ¶
type ErrorInjectorSpanListener struct { ErrorMessage string ErrorType error InjectOnFinish bool InjectCountFreq int64 AddInfoTags bool // contains filtered or unexported fields }
func (*ErrorInjectorSpanListener) OnSpanFinished ¶
func (e *ErrorInjectorSpanListener) OnSpanFinished(span *spanImpl)
func (*ErrorInjectorSpanListener) OnSpanStarted ¶
func (e *ErrorInjectorSpanListener) OnSpanStarted(span *spanImpl)
func (*ErrorInjectorSpanListener) PanicOnError ¶
func (e *ErrorInjectorSpanListener) PanicOnError() bool
type FilteringSpanListener ¶
type FilteringSpanListener struct { Listener ThundraSpanListener Filterer SpanFilterer }
func (*FilteringSpanListener) OnSpanFinished ¶
func (f *FilteringSpanListener) OnSpanFinished(span *spanImpl)
func (*FilteringSpanListener) OnSpanStarted ¶
func (f *FilteringSpanListener) OnSpanStarted(span *spanImpl)
func (*FilteringSpanListener) PanicOnError ¶
func (f *FilteringSpanListener) PanicOnError() bool
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 LatencyInjectorSpanListener ¶
type LatencyInjectorSpanListener struct { Delay int64 InjectOnFinish bool RandomizeDelay bool AddInfoTags bool }
func (*LatencyInjectorSpanListener) OnSpanFinished ¶
func (l *LatencyInjectorSpanListener) OnSpanFinished(span *spanImpl)
func (*LatencyInjectorSpanListener) OnSpanStarted ¶
func (l *LatencyInjectorSpanListener) OnSpanStarted(span *spanImpl)
func (*LatencyInjectorSpanListener) PanicOnError ¶
func (l *LatencyInjectorSpanListener) PanicOnError() bool
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.
type SecurityAwareSpanListener ¶
type SecurityAwareSpanListener struct {
// contains filtered or unexported fields
}
func (*SecurityAwareSpanListener) OnSpanFinished ¶
func (s *SecurityAwareSpanListener) OnSpanFinished(span *spanImpl)
func (*SecurityAwareSpanListener) OnSpanStarted ¶
func (s *SecurityAwareSpanListener) OnSpanStarted(span *spanImpl)
func (*SecurityAwareSpanListener) PanicOnError ¶
func (s *SecurityAwareSpanListener) PanicOnError() bool
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.
type SpanFilter ¶
type SpanFilter interface {
Accept(*spanImpl) bool
}
type SpanFilterer ¶
type SpanFilterer interface {
Accept(*spanImpl) bool
}
type SpanRecorder ¶
SpanRecorder handles all of the `RawSpan` data generated via an associated `Tracer`
type TagInjectorSpanListener ¶
type TagInjectorSpanListener struct {
// contains filtered or unexported fields
}
func (*TagInjectorSpanListener) OnSpanFinished ¶
func (t *TagInjectorSpanListener) OnSpanFinished(span *spanImpl)
func (*TagInjectorSpanListener) OnSpanStarted ¶
func (t *TagInjectorSpanListener) OnSpanStarted(span *spanImpl)
func (*TagInjectorSpanListener) PanicOnError ¶
func (t *TagInjectorSpanListener) PanicOnError() bool
type ThundraSpanFilter ¶
type ThundraSpanFilter struct { DomainName string ClassName string OperationName string Reverse bool Tags ot.Tags }
func NewThundraSpanFilter ¶
func NewThundraSpanFilter(config map[string]interface{}) *ThundraSpanFilter
NewThundraSpanFilter creates and returns a new ThundraSpanFilter from config
func (*ThundraSpanFilter) Accept ¶
func (t *ThundraSpanFilter) Accept(span *spanImpl) bool
type ThundraSpanFilterer ¶
type ThundraSpanFilterer struct {
// contains filtered or unexported fields
}
func (*ThundraSpanFilterer) Accept ¶
func (t *ThundraSpanFilterer) Accept(span *spanImpl) bool
func (*ThundraSpanFilterer) AddFilter ¶
func (t *ThundraSpanFilterer) AddFilter(sf SpanFilter)
func (*ThundraSpanFilterer) ClearFilters ¶
func (t *ThundraSpanFilterer) ClearFilters()
type ThundraSpanListener ¶
type ThundraSpanListener interface { OnSpanStarted(*spanImpl) OnSpanFinished(*spanImpl) PanicOnError() bool }
func GetSpanListeners ¶
func GetSpanListeners() []ThundraSpanListener
func NewErrorInjectorSpanListener ¶
func NewErrorInjectorSpanListener(config map[string]interface{}) ThundraSpanListener
NewErrorInjectorSpanListener creates and returns a new ErrorInjectorSpanListener from config
func NewFilteringSpanListener ¶
func NewFilteringSpanListener(config map[string]interface{}) ThundraSpanListener
NewFilteringSpanListener creates and returns a new FilteringSpanListener from config
func NewLatencyInjectorSpanListener ¶
func NewLatencyInjectorSpanListener(config map[string]interface{}) ThundraSpanListener
NewLatencyInjectorSpanListener creates and returns a new LatencyInjectorSpanListener from config
func NewSecurityAwareSpanListener ¶
func NewSecurityAwareSpanListener(config map[string]interface{}) ThundraSpanListener
func NewTagInjectorSpanListener ¶
func NewTagInjectorSpanListener(config map[string]interface{}) ThundraSpanListener