Skip to content
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
Next Next commit
feat: add support for mongodb v6
  • Loading branch information
david-luna committed Oct 30, 2023
commit d181f3d389c0272f378331f490367e1f6ab50042
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mongodb:
commands: npm run test-v3
- versions: ">=4 <5"
commands: npm run test-v4
- versions: ">=5 <6"
- versions: ">=5 <7"
commands: npm run test-v5

# Fix missing `contrib-test-utils` package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

* **mongodb:** support v6 ([#1666](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1666))

Copy link
Member

Choose a reason for hiding this comment

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

Changelog is automatically updated by the release automation. There is no need to do it here. It comes from the PR title.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed :)

## [0.37.1](https://github.com/open-telemetry/opentelemetry-js-contrib/compare/instrumentation-mongodb-v0.37.0...instrumentation-mongodb-v0.37.1) (2023-10-10)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-mongodb

### Supported Versions

- `>=3.3 <5`
- `>=3.3 <7`

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"docker:start": "docker run -e MONGODB_DB=opentelemetry-tests -e MONGODB_PORT=27017 -e MONGODB_HOST=127.0.0.1 -p 27017:27017 --rm mongo",
"test": "npm run test-v3",
"test": "npm run test-v5",
"test-v3": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'",
"test-v4": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5.metrics.test.ts' 'test/**/mongodb-v4.test.ts'",
"test-v5": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5.metrics.test.ts' 'test/**/mongodb-v5.test.ts'",
"test-all-versions": "tav",
"test-v4": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v4.test.ts'",
"test-v5": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4-v5-v6.metrics.test.ts' 'test/**/mongodb-v5-v6.test.ts'",
"test-all-versions": "RUN_MONGODB_TESTS=true tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"lint": "eslint . --ext .ts",
Expand Down Expand Up @@ -53,25 +53,25 @@
},
"devDependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/contrib-test-utils": "^0.34.2",
"@opentelemetry/context-async-hooks": "^1.8.0",
"@opentelemetry/contrib-test-utils": "^0.34.2",
"@opentelemetry/sdk-trace-base": "^1.8.0",
"@opentelemetry/sdk-trace-node": "^1.8.0",
"@types/bson": "4.0.5",
"@types/mocha": "7.0.2",
"@types/mongodb": "3.6.20",
"@types/node": "18.6.5",
"mocha": "7.2.0",
"mongodb": "3.6.11",
"mongodb": "^6.2.0",
"nyc": "15.1.0",
"rimraf": "5.0.5",
"test-all-versions": "5.0.1",
"ts-mocha": "10.0.0",
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/sdk-metrics": "^1.9.1",
"@opentelemetry/instrumentation": "^0.44.0",
"@opentelemetry/sdk-metrics": "^1.9.1",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb#readme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,31 @@ export class MongoDBInstrumentation extends InstrumentationBase {
),
new InstrumentationNodeModuleDefinition<any>(
'mongodb',
['4.*', '5.*'],
['4.*', '5.*', '6.*'],
undefined,
undefined,
[
new InstrumentationNodeModuleFile<V4Connection>(
'mongodb/lib/cmap/connection.js',
['4.*', '5.*'],
['4.*', '5.*', '6.*'],
v4PatchConnection,
v4UnpatchConnection
),
new InstrumentationNodeModuleFile<V4ConnectionPool>(
'mongodb/lib/cmap/connection_pool.js',
['4.*', '5.*'],
['4.*', '5.*', '6.*'],
v4PatchConnectionPool,
v4UnpatchConnectionPool
),
new InstrumentationNodeModuleFile<V4Connect>(
'mongodb/lib/cmap/connect.js',
['4.*', '5.*'],
['4.*', '5.*', '6.*'],
v4PatchConnect,
v4UnpatchConnect
),
new InstrumentationNodeModuleFile<V4Session>(
'mongodb/lib/sessions.js',
['4.*', '5.*'],
['4.*', '5.*', '6.*'],
v4PatchSessions,
v4UnpatchSessions
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe('MongoDBInstrumentation-Tracing-v5', () => {
'mongodb.insert',
SpanKind.CLIENT,
'insert',
URL
URL,
);
done();
})
Expand Down