Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for tedious v19 #4219

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ See the <<upgrade-to-v4>> guide.
AWS ECS Fargate, where the pattern has been observed to sometimes differ
from the documented pattern. (https://github.com/elastic/apm/issues/888[APM spec issue #888])

- Add support for `tedious` v19. ({issues}4218[#4218])


[float]
===== Bug fixes
Expand Down
13 changes: 12 additions & 1 deletion lib/instrumentation/modules/tedious.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ 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 <19')) {
if (
semver.satisfies(version, '>=19') &&
!semver.satisfies(process.version, '>=18.17')
) {
agent.logger.debug(
'tedious version %s not supported for node %s - aborting...',
version,
process.version,
);
return tedious;
}
if (version === '4.0.0' || !semver.satisfies(version, '>=1.9.0 <20')) {
agent.logger.debug(
'tedious version %s not supported - aborting...',
version,
Expand Down
16 changes: 8 additions & 8 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 @@ -200,7 +200,7 @@
"restify": "^11.0.0",
"rimraf": "^3.0.2",
"tape": "^5.0.0",
"tedious": "^18.1.0",
"tedious": "^19.0.0",
"test-all-versions": "^6.1.0",
"thunky": "^1.1.0",
"tree-kill": "^1.2.2",
Expand Down
4 changes: 3 additions & 1 deletion test/instrumentation/modules/tedious.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ if (
// tedious@11 and later depend on @azure/identity v1 or v2. As of
// @azure/core-rest-pipeline@1.15.0 (a dep of @azure/identity), support for
// Node.js <16 has been broken.
(semver.gte(tediousVer, '11.0.0') && semver.lt(process.version, '16.0.0'))
(semver.gte(tediousVer, '11.0.0') && semver.lt(process.version, '16.0.0')) ||
// tedious@19 drops support for Node.js <v18.17
(semver.gte(tediousVer, '19.0.0') && semver.lt(process.version, '18.17.0'))
) {
console.log(
`# SKIP tedious@${tediousVer} does not support node ${process.version}`,
Expand Down