Documentation ¶
Overview ¶
package sql provides SQL driver wrapper with tracing capabilities, compatible with Opentracing API.
Index ¶
Constants ¶
const TagQuery = "query"
TagQuery is a span tag for SQL queries.
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 SpanNameFunction ¶
func SpanNameFunction(f SpanNameFunc) func(*tracingDriver)
SpanNameFunction is an option for using a custom span naming function.
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.