Signed-off-by: bergquist <carl.bergquist@gmail.com>
(cherry picked from commit b4e3c89f60)
Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
This commit is contained in:
co-authored by
Carl Bergquist
parent
bb398e9aac
commit
ed52d422c1
@@ -109,9 +109,17 @@ func (h *databaseQueryWrapper) instrument(ctx context.Context, status string, qu
|
||||
|
||||
// OnError will be called if any error happens
|
||||
func (h *databaseQueryWrapper) OnError(ctx context.Context, err error, query string, args ...interface{}) error {
|
||||
status := "error"
|
||||
// Not a user error: driver is telling sql package that an
|
||||
// optional interface method is not implemented. There is
|
||||
// nothing to instrument here.
|
||||
// https://golang.org/pkg/database/sql/driver/#ErrSkip
|
||||
if err == nil || errors.Is(err, driver.ErrSkip) {
|
||||
// https://github.com/DataDog/dd-trace-go/issues/270
|
||||
if errors.Is(err, driver.ErrSkip) {
|
||||
return nil
|
||||
}
|
||||
|
||||
status := "error"
|
||||
if err == nil {
|
||||
status = "success"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user