Skip to content

implement driver.Validator on otConn - #619

Merged
XSAM merged 2 commits into
XSAM:mainfrom
Twister915:implement-driver-validator
Apr 8, 2026
Merged

XSAM merged 2 commits into
XSAM:mainfrom
Twister915:implement-driver-validator

Conversation

@Twister915

@Twister915 Twister915 commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor

This is my proposed fix for #618. I implement driver.Validator on *otConn.

I have an alternate version of this locally (which I am happy to push if you'd like), which adds IsValid() to the existing mockConn instead of introducing a separate mock type, if you like. But that would make it a little tricky to test the case where a connection does not implement IsValid()

@Twister915
Twister915 requested a review from XSAM as a code owner April 7, 2026 13:52
@codecov

codecov Bot commented Apr 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.4%. Comparing base (852a8a9) to head (508f519).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #619   +/-   ##
=====================================
  Coverage   86.3%   86.4%           
=====================================
  Files         16      16           
  Lines        748     752    +4     
=====================================
+ Hits         646     650    +4     
  Misses        75      75           
  Partials      27      27           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Twister915
Twister915 force-pushed the implement-driver-validator branch from ab96c09 to 75dde6b Compare April 7, 2026 13:59

@XSAM XSAM left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @Twister915, for the PR and the clean fix.

Could you update the changelog file to reflect this change?

@Twister915
Twister915 force-pushed the implement-driver-validator branch from 75dde6b to eb8a32b Compare April 8, 2026 18:16
@Twister915

Copy link
Copy Markdown
Contributor Author

@XSAM done!

Comment thread CHANGELOG.md Resolved
@XSAM
XSAM enabled auto-merge (squash) April 8, 2026 20:38
@XSAM
XSAM merged commit 31f7989 into XSAM:main Apr 8, 2026
15 checks passed
@XSAM XSAM added this to the v0.43.0 milestone Apr 8, 2026
@XSAM XSAM mentioned this pull request Jul 13, 2026
XSAM added a commit that referenced this pull request Jul 13, 2026
### Removed

- **BREAKING** Remove support for `OTEL_SEMCONV_STABILITY_OPT_IN`
environment variable, legacy `db.sql.latency` metric, and `db.statement`
span attribute. Only stable Semantic Conventions are now used. (#617)

### Changed

- ~~Upgrade OTel Semconv to `v1.40.0`.~~ (#606)
- Upgrade OTel Semconv to `v1.44.0`. (#615)

### Fixed

- Implement `driver.Validator` on `otConn` so that `database/sql`
connection pool health checks are properly delegated to the underlying
driver connection. (#619)
- `AttributesFromDSN` no longer panics on DSNs that wrap a unix-socket
path in the `protocol(/path/to.sock)` form, e.g.
`unix(/tmp/mysql.sock)/dbname`. The parser now extracts the address from
inside the parentheses before splitting on `/`. (#625)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants