Documentation ¶
Overview ¶
Package apmsql provides wrappers for tracing SQL query spans.
Index ¶
Constants ¶
const DriverPrefix = "elasticapm/"
DriverPrefix should be used as a driver name prefix when registering via sql.Register.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open opens a database with the given driver and data source names, as in sql.Open. The driver name should be one registered via the Register function in this package.
func Register ¶
func Register(name string, driver driver.Driver, opts ...WrapOption)
Register registers a traced version of the given driver.
The name and driver values should be the same as given to sql.Register: the name of the driver (e.g. "postgres"), and the driver (e.g. &github.com/lib/pq.Driver{}).
Types ¶
type DSNInfo ¶
type DSNInfo struct { // Database is the name of the specific database identified by the DSN. Database string // User is the username that the DSN specifies for authenticating the // database connection. User string }
DSNInfo contains information from a database-specific data source name.
type DSNParserFunc ¶
DSNParserFunc is the type of a function that can be used for parsing a data source name, and returning the corresponding Info.
type WrapOption ¶
type WrapOption func(*tracingDriver)
WrapOption is an option that can be supplied to Wrap.
func WithDSNParser ¶
func WithDSNParser(f DSNParserFunc) WrapOption
WithDSNParser returns a WrapOption which sets the function to use for parsing the data source name. If WithDSNParser is not supplied to Wrap, the function to use will be inferred from the driver name.
func WithDriverName ¶
func WithDriverName(name string) WrapOption
WithDriverName returns a WrapOption which sets the underlying driver name to the specified value. If WithDriverName is not supplied to Wrap, the driver name will be inferred from the driver supplied to Wrap.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package apmmysql registers the "mysql" driver with apmsql, so that you can trace go-sql-driver/mysql database connections.
|
Package apmmysql registers the "mysql" driver with apmsql, so that you can trace go-sql-driver/mysql database connections. |
Package apmpq registers the "postgres" driver with apmsql, so that you can trace lib/pq database connections.
|
Package apmpq registers the "postgres" driver with apmsql, so that you can trace lib/pq database connections. |
Package apmsqlite3 registers the "sqlite3" driver with apmsql, so that you can trace sqlite3 database connections.
|
Package apmsqlite3 registers the "sqlite3" driver with apmsql, so that you can trace sqlite3 database connections. |