Skip to content

Commit

Permalink
fix: we don't support mongodb-core v3.1.10+ (#792)
Browse files Browse the repository at this point in the history
Version 3.1.10 of mongodb-core removed the _find method that we depended
upon to start new spans. Until we find a workaround for this, we'll have
to drop support for this and newer versions.
  • Loading branch information
watson authored and Qard committed Jan 16, 2019
1 parent 2034033 commit 19fa199
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .tav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pg:
- node test/instrumentation/modules/pg/pg.js
- node test/instrumentation/modules/pg/knex.js
mongodb-core:
versions: '>=1.2.19 <4'
versions: '>=1.2.19 <3.1.10'
commands: node test/instrumentation/modules/mongodb-core.js
bluebird:
versions: '>=2 <4'
Expand Down
2 changes: 1 addition & 1 deletion docs/supported-technologies.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The Node.js agent will automatically instrument the following modules to give yo
|https://www.npmjs.com/package/graphql[graphql] |>=0.7.0 <15.0.0 |Will instrument all queries
|https://www.npmjs.com/package/handlebars[handlebars] |* |Will instrument compile and render calls
|https://www.npmjs.com/package/ioredis[ioredis] |>=2.0.0 <5.0.0 |Will instrument all queries
|https://www.npmjs.com/package/mongodb-core[mongodb-core] |>=1.2.19 <4.0.0 |Will instrument all queries.
|https://www.npmjs.com/package/mongodb-core[mongodb-core] |>=1.2.19 <3.1.10 |Will instrument all queries.
A lot of higher level MongoDB modules use mongodb-core,
so those should be supported as well
|https://www.npmjs.com/package/mongodb[mongodb] |>=2.0.0 |Supported via mongodb-core
Expand Down
2 changes: 1 addition & 1 deletion lib/instrumentation/modules/mongodb-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var CURSOR_FNS_FIRST = ['_find', '_getmore']

module.exports = function (mongodb, agent, version, enabled) {
if (!enabled) return mongodb
if (!semver.satisfies(version, '>=1.2.19 <4.0.0')) {
if (!semver.satisfies(version, '>=1.2.19 <3.1.10')) {
agent.logger.debug('mongodb-core version %s not supported - aborting...', version)
return mongodb
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"koa-router": "^7.4.0",
"mimic-response": "^1.0.1",
"mkdirp": "^0.5.1",
"mongodb-core": "^3.1.7",
"mongodb-core": "3.1.9",
"mysql": "^2.16.0",
"mysql2": "^1.6.3",
"ndjson": "^1.5.0",
Expand Down

0 comments on commit 19fa199

Please sign in to comment.