Documentation
¶
Index ¶
- Variables
- func SpanContextFromSerialized(serialized map[string]string, childName string) (opentracing.Span, error)
- func StartElastic()
- func StartJaeger(serviceName string)
- func StopJaeger()
- type ContextHolder
- func (ch *ContextHolder) GetContext() context.Context
- func (ch *ContextHolder) LogKV(key string, value interface{})deprecated
- func (ch *ContextHolder) NewSpan(name string) opentracing.Span
- func (ch *ContextHolder) RehydrateSerialized(serialized map[string]string, childName string) (opentracing.Span, error)
- func (ch *ContextHolder) SerializedContext() (map[string]string, error)
- func (ch *ContextHolder) SetContext(ctx context.Context)
- func (ch *ContextHolder) SetTag(key string, value interface{})
- func (ch *ContextHolder) StartTrace(name string) opentracing.Span
- func (ch *ContextHolder) Started() bool
- func (ch *ContextHolder) StopTrace()
- type Contextable
- type Traceable
Constants ¶
This section is empty.
Variables ¶
var Enabled bool
Functions ¶
func SpanContextFromSerialized ¶
func SpanContextFromSerialized(serialized map[string]string, childName string) (opentracing.Span, error)
SpanContextFromSerialized takes the output of SerializedContext and starts a new span with the childName
func StartElastic ¶
func StartElastic()
func StartJaeger ¶
func StartJaeger(serviceName string)
func StopJaeger ¶
func StopJaeger()
Types ¶
type ContextHolder ¶
type ContextHolder struct {
// contains filtered or unexported fields
}
ContextHolder is a struct that you can include in your actor structs in order to make them easily traceable
func (*ContextHolder) GetContext ¶
func (ch *ContextHolder) GetContext() context.Context
GetContext returns the current context
func (*ContextHolder) LogKV
deprecated
func (ch *ContextHolder) LogKV(key string, value interface{})
Deprecated: Use SetTag instead
func (*ContextHolder) NewSpan ¶
func (ch *ContextHolder) NewSpan(name string) opentracing.Span
NewSpan returns a new span as a child of whatever span is already in the context.
func (*ContextHolder) RehydrateSerialized ¶
func (ch *ContextHolder) RehydrateSerialized(serialized map[string]string, childName string) (opentracing.Span, error)
RehydrateSerialized takes the output of SerializedContext and starts a new span with the childName and sets up the context to the correct value. WARNING : this will overwrite any context that has previously been set (this is usually the first thing to be called)
func (*ContextHolder) SerializedContext ¶
func (ch *ContextHolder) SerializedContext() (map[string]string, error)
SerializedContext returns a text map of the current span context
func (*ContextHolder) SetContext ¶
func (ch *ContextHolder) SetContext(ctx context.Context)
SetContext overrides the current context of the ContextHolder
func (*ContextHolder) SetTag ¶
func (ch *ContextHolder) SetTag(key string, value interface{})
SetTag sets a tag on the span
func (*ContextHolder) StartTrace ¶
func (ch *ContextHolder) StartTrace(name string) opentracing.Span
StartTrace starts the parent trace of a ContextHolder
func (*ContextHolder) Started ¶
func (ch *ContextHolder) Started() bool
Started returns whether or not the traceable has begun its parent trace or not
func (*ContextHolder) StopTrace ¶
func (ch *ContextHolder) StopTrace()
StopTrace stops the parent trace of a ContextHolder
type Contextable ¶
Contextable defines an interface for getting and setting a context ContentHolder implements the interface.
type Traceable ¶
type Traceable interface { Contextable StartTrace(name string) opentracing.Span StopTrace() Started() bool NewSpan(name string) opentracing.Span LogKV(key string, value interface{}) // deprecated: Use SetTag instead SetTag(key string, value interface{}) SerializedContext() (map[string]string, error) RehydrateSerialized(serialized map[string]string, childName string) (opentracing.Span, error) }
Traceable defines the interface necessary to make an actor struct traceable. ContextHolder implements this interface.