Documentation ¶
Overview ¶
Package opentracing provides an opentracing-go Tracer that is compatible with the sqltracing.Tracer interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultTracingTags = opentracing.Tags{ string(ext.Component): "sqltracing", string(ext.DBType): "sql", string(ext.SpanKind): string(ext.SpanKindRPCClientEnum), }
DefaultTracingTags are the tags that are added by default to all traces.
Functions ¶
func NewTracer ¶
func NewTracer(opts ...Opt) sqltracing.Tracer
NewTracer returns a tracer that will create spans via opentracing-go. When no options are specified, opentracing.GlobalTracer is used as default Tracer, DefaultTracingTags are used as tags and TraceOrphans is enabled.
Types ¶
type Opt ¶
type Opt func(*tracer)
Opt is a type for options that can be passed to NewTracer.
func WithTracer ¶
func WithTracer(fn func() opentracing.Tracer) Opt
WithTracer is an option for NewTracer() to use a custom function to retrieve the opentracing Tracer to use.
func WithTracingTags ¶
func WithTracingTags(tags opentracing.Tags) Opt
WithTracingTags is an option for NewTracer() to set the tags that are applied to all traces created by StartSpan().
func WithoutTracingOrphans ¶
func WithoutTracingOrphans() Opt
WithoutTracingOrphans is an option for NewTracer() to disable tracing spans if no parent span exist in the context.