otsql

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 7 Imported by: 0

README

otsql

OpenTelemetry tracing integration for the database/sql package.

Usage

If using github.com/lib/pq:

var tracer trace.Tracer

db, err := sql.Open(otsql.WrapDriver("postgres", &pq.Driver{}, tracer), dsn)
if err != nil {
    return errors.Wrap(err, "opening DB")
}

Same thing for any other SQL library (MySQL or wtv).

License

MIT.

Credits

Pretty much copy-pasta from github.com/ExpansiveWorlds/instrumentedsql, which is also MIT licensed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapDriver

func WrapDriver(nameSuffix string, driver driver.Driver, tracer trace.Tracer) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL