Documentation ¶
Index ¶
- func LogFromSpan(span opentracing.Span) logrus.FieldLogger
- func NewTraceHook(span opentracing.Span) logrus.Hook
- type SpanHelper
- func CopySpan(ctx context.Context, spanContext SpanHelper, operation string) SpanHelper
- func FromContext(ctx context.Context, operation string) (result SpanHelper)
- func GetSpanHelper(ctx context.Context) SpanHelper
- func NewSpanHelper(ctx context.Context, span opentracing.Span, operation string) SpanHelper
- func WithSpan(ctx context.Context, span opentracing.Span, operation string) (result SpanHelper)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogFromSpan ¶
func LogFromSpan(span opentracing.Span) logrus.FieldLogger
LogFromSpan - return a logger that has a TraceHook to also log messages to the span
func NewTraceHook ¶
NewTraceHook - create a TraceHook for also logging to a span
Types ¶
type SpanHelper ¶
type SpanHelper interface { Finish() Context() context.Context Logger() logrus.FieldLogger LogObject(attribute string, value interface{}) LogValue(attribute string, value interface{}) LogError(err error) Span() opentracing.Span }
SpanHelper - wrap span if specified to simplify workflow
func CopySpan ¶
func CopySpan(ctx context.Context, spanContext SpanHelper, operation string) SpanHelper
CopySpan - construct span helper object with ctx and copy span from spanContext Will start new operation on span
func FromContext ¶
func FromContext(ctx context.Context, operation string) (result SpanHelper)
FromContext - return span helper from context and if opentracing is enabled start new span
func GetSpanHelper ¶
func GetSpanHelper(ctx context.Context) SpanHelper
GetSpanHelper - construct a span helper object from current context span
func NewSpanHelper ¶
func NewSpanHelper(ctx context.Context, span opentracing.Span, operation string) SpanHelper
NewSpanHelper - constructs a span helper from context/snap and opertaion name.
Click to show internal directories.
Click to hide internal directories.