Skip to content

Commit

Permalink
feat: add support for tedious v17 (#3901)
Browse files Browse the repository at this point in the history
Co-authored-by: Trent Mick <[email protected]>
  • Loading branch information
david-luna and trentm authored Mar 7, 2024
1 parent b83a75b commit d4daa4d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .tav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ tedious:
- versions: '16.0.0 || 16.1.0 || >16.1.0 <17' # first and last majors subset of '16.x'
node: '>=16'
commands: node test/instrumentation/modules/tedious.test.js
- versions: '>=17.0.0 <18' # first and last majors subset of '17.x' (as for now there is only v17.0.0)
node: '18.x || >=20'
commands: node test/instrumentation/modules/tedious.test.js

cassandra-driver:
# 3.1.0 is broken
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ See the <<upgrade-to-v4>> guide.
===== Features
* Update <<opentelemetry-bridge>> support to `@opentelemetry/api` version 1.8.0.
* Add support for `tedious` version v17. ({pull}3901[#3901])
[float]
===== Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion docs/supported-technologies.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ so those should be supported as well.
|https://www.npmjs.com/package/mysql2[mysql2] |>=1.0.0 <4.0.0 |Will instrument all queries
|https://www.npmjs.com/package/pg[pg] |>=4.0.0 <9.0.0 |Will instrument all queries
|https://www.npmjs.com/package/redis[redis] |>=2.0.0 <5.0.0 |Will instrument all queries
|https://www.npmjs.com/package/tedious[tedious] |>=1.9 <17.0.0 | (Excluding v4.0.0.) Will instrument all queries
|https://www.npmjs.com/package/tedious[tedious] |>=1.9 <18.0.0 | (Excluding v4.0.0.) Will instrument all queries
|https://www.npmjs.com/package/undici[undici] | >=4.7.1 <6 | Will instrument undici HTTP requests, except HTTP CONNECT. Requires node v14.17.0 or later, or the user to have installed the https://www.npmjs.com/package/diagnostics_channel['diagnostics_channel' polyfill].
|https://www.npmjs.com/package/ws[ws] |>=1.0.0 <8.0.0 |Will instrument outgoing WebSocket messages
|=======================================================================
Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/tedious.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var { getDBDestination } = require('../context');

module.exports = function (tedious, agent, { version, enabled }) {
if (!enabled) return tedious;
if (version === '4.0.0' || !semver.satisfies(version, '>=1.9.0 <17')) {
if (version === '4.0.0' || !semver.satisfies(version, '>=1.9.0 <18')) {
agent.logger.debug(
'tedious version %s not supported - aborting...',
version,
Expand Down
18 changes: 8 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
"rimraf": "^5.0.1",
"tap-junit": "^5.0.1",
"tape": "^5.0.0",
"tedious": "^16.1.0",
"tedious": "^17.0.0",
"test-all-versions": "^6.1.0",
"thunky": "^1.1.0",
"tree-kill": "^1.2.2",
Expand Down
1 change: 1 addition & 0 deletions test/instrumentation/modules/tedious.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const tediousVer =
require('../../../node_modules/tedious/package.json').version;
const semver = require('semver');
if (
(semver.gte(tediousVer, '17.0.0') && semver.lt(process.version, '18.0.0')) ||
(semver.gte(tediousVer, '16.0.0') && semver.lt(process.version, '16.0.0')) ||
(semver.gte(tediousVer, '15.0.0') && semver.lt(process.version, '14.0.0')) ||
(semver.gte(tediousVer, '12.0.0') && semver.lt(process.version, '12.3.0')) ||
Expand Down

0 comments on commit d4daa4d

Please sign in to comment.