Categorygithub.com/simplesurance/sqltracing
modulepackage
0.2.1
Repository: https://github.com/simplesurance/sqltracing.git
Documentation: pkg.go.dev

# README

sqltracing

CI Go Report Card GoDoc

sqltracing is a Go package for tracing database operations via an OpenTracing tracer. It can wrap any driver.Driver compatible SQL driver.

It is implemented as an interceptor for simplesurance/sqlmw.

Documentation

Go Package Documentation

Example

See example_test.go

Known Issues

  • Transactions: all operations on transactions except Commit() and Rollback() are recorded as independent spans, instead of as child spans of the BeginTx() operation

Credits

sqltracing and simplesurance/sqlmw are based heavily on forks and the ideas of the following projects:

# Packages

No description provided by the author

# Functions

NewInterceptor returns a new interceptor that records traces for database operations.
WithOpsExcluded can be passed when creating an Interceptor.
WrapDriver returns a driver that wraps the passed driver and records traces for it's operations.

# Constants

DBStatementTagKey is the name of the tracing that contains db query statements.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.
Defines the names of SQL operations.

# Structs

Interceptor records traces for database operations.

# Interfaces

Span is part of the interface that needs to be implemented by Tracers.
Tracer defines the required methods of a Tracer implementation.

# Type aliases

Opt is a type for options for the Interceptor.
SQLOp is the name of an sql operation.