Documentation
¶
Overview ¶
Package xraysql provides AWS X-Ray tracing for SQL.
xraysql is drop-in replacement for database/sql. Use xraysql.Open instead of database/sql.Open.
db, err := xraysql.Open("postgres", "postgres://user:password@host:port/db")
if err != nil {
panic(err)
}
row, err := db.QueryRowContext(ctx, "SELECT 1")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnector ¶
NewConnector wraps the connector.
func Open ¶
Open is a drop-in replacement for database/sql.Open. It returns a *database/sql.DB that is instrumented for AWS X-Ray.
func OpenDB ¶
OpenDB is a drop-in replacement for database/sql.OpenDB. It returns a *database/sql.DB that is instrumented for AWS X-Ray.
Types ¶
type Option ¶
type Option func(*config)
Option is an option of SQL tracer.
func WithConnectionString ¶
WithConnectionString configures the data source name that is recorded in the X-Ray segment. By default, the tracer doesn't record the data source to avoid recording secrets such as passwords.