Skip to content

An driver.ErrSkip error is logged during query execution #556

Closed

Description

@titpetric

Description

An sql/driver.ErrSkip error is logged during query execution. The error is an implementation detail and should be excluded from being logged in the span.

Environment

  • OS: linux
  • Architecture: x86
  • Go Version: 1.25
  • otelsql version: 0.40.0

Steps To Reproduce

Image

Expected behavior

var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented")

ErrSkip may be returned by some optional interfaces' methods to indicate at runtime that the fast path is unavailable and the sql package should continue as if the optional interface was not implemented. ErrSkip is only supported where explicitly documented.

The description of the error itself suggests that it should be excluded from logging, logging a span is not the expected behaviour for this error.

Activity

  1. added
    bug
    on Oct 31, 2025
  2. titpetric commented on Oct 31, 2025

    @titpetric
    Author

    I see there's an option to supposedly toggle this:

    https://pkg.go.dev/github.com/XSAM/otelsql#WithDisableSkipErrMeasurement

    I still see sql.conn.query logged with errors.

            db, err := otelsql.Open(driver, dsn, otelsql.WithDisableSkipErrMeasurement(true))

    Finally got it working with otelsql.WithSpanOptions(otelsql.SpanOption{DisableErrSkip: true}). The internal function recordSpanError doesn't have a config struct in scope, doesn't use the DisableSkipErrMeasurement value. It's a bit inconvenient, what do you think?

  3. XSAM commented on Nov 13, 2025

    @XSAM
    Owner

    Hey @titpetric, thanks for creating this issue.

    The DisableSkipErrMeasurement only affects the metrics behavior. Maybe I should update the doc that says explicitly metrics.

  4. added a commit that references this issue on Dec 15, 2025
    7ff0bc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions