Documentation ¶
Overview ¶
package sql provides SQL driver wrapper with tracing capabilities, compatible with Opentracing API.
Index ¶
- Variables
- func NewTracingDriver(d driver.Driver, t opentracing.Tracer, options ...func(*tracingDriver)) driver.Driver
- func SaveQuery(f SpanNameFunc) func(*tracingDriver)
- func SetTagQuery(tag string)
- func SpanNameFunction(f SpanNameFunc) func(*tracingDriver)
- func WithSpanObserver(obsFunc func(context.Context, opentracing.Span, string)) func(*tracingDriver)
- type SpanNameFunc
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupported = errors.New("operation unsupported by the underlying driver")
ErrUnsupported is an error returned when the underlying driver doesn't provide a given function.
Functions ¶
func NewTracingDriver ¶
func NewTracingDriver(d driver.Driver, t opentracing.Tracer, options ...func(*tracingDriver)) driver.Driver
TracingDriver creates and returns a new SQL driver with tracing capabilities.
func SaveQuery ¶
func SaveQuery(f SpanNameFunc) func(*tracingDriver)
SaveQuery is an option for saving SQL queries.
func SetTagQuery ¶
func SetTagQuery(tag string)
SetTagQuery sets a span tag for SQL queries. Use in init funcs only.
func SpanNameFunction ¶
func SpanNameFunction(f SpanNameFunc) func(*tracingDriver)
SpanNameFunction is an option for using a custom span naming function.
func WithSpanObserver ¶
WithSpanObserver allows you to modify the span's tags for every span created.
Types ¶
type SpanNameFunc ¶
SpanNameFunc defines a function which returns a name for the span which is being created on traceable operations. Passing span naming function is optional, however it gives the user a way to use a custom naming strategy. To allow getting some more information related to the current call, the context, which is passed with the call, is propagated to the naming function.