Skip to content

Commit

Permalink
feat(mongodb): collect mongodb4 metrics (open-telemetry#1170)
Browse files Browse the repository at this point in the history
* feat(mongodb): started working on mongodb connection pool instrumentations

* feat(mongodb): started working on mongodb connection pool instrumentations

* feat(mongodb): started working on mongodb connection pool instrumentations

* feat(mongodb): started working on mongodb connection pool instrumentations

* feat(mongodb): added connection metrics mongodb4 before tests

* feat(mongodb): started working on tests

* feat(mongodb): started working on tests

* feat(mongodb): started working on tests

* feat(mongodb): started working on tests

* feat(mongodb): started working on tests

* feat(mongodb): added mongodb4 metric tests

* feat(mongodb): added mongodb4 metric tests

* feat(mongodb): added mongodb4 metric tests

* feat(mongodb): started working on mongodb3 metrics

* feat(mongodb): removed <4 supprot

* fix(mongo4): mongodb v4 instrumentation. fix idle/used counting

* fix(mongo4): lint

* fix(mongo4): use _updateMetricInstruments() as described in open-telemetry#3267

* fix(mongo4): lint

* fix(mongo4): change deps

* fix(mongo4): change deps 2

* fix(mongo4): revert deps

* fix(mongo4): fixes

* fix(mongo4): lint

* fix(mongo4): lexport type

* fix(mongo4): fixes

* fix(mongo4): fixes

* fix(mongo4): fixes: remote redundant from types, remove unneeded comments

* fix(mongo4): add connection_string

* fix(mongo4): add undefined instead of connection_string for for mongo v3

* Update plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts

Co-authored-by: Marc Pichler <[email protected]>

* Update plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts

Co-authored-by: Marc Pichler <[email protected]>

* fix(mongo4): move V4Connect and V4Session to internal-types

* fix(mongo): lint

* fix(mongo): align metric description with semconv

* Update plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.metrics.test.ts

Co-authored-by: Marc Pichler <[email protected]>

* fix(mongo): fix sessions.length to work also for versions 4.1 - 4.11

* fix(mongo): try to fix TAV for node 16 & 18 that doesn't work for mongo 3.6.2

---------

Co-authored-by: haddasbronfman <[email protected]>
Co-authored-by: Haddas Bronfman <[email protected]>
Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
4 people authored May 23, 2023
1 parent 418b6f6 commit 988e1f8
Show file tree
Hide file tree
Showing 9 changed files with 555 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@opentelemetry/instrumentation-mongodb": "^0.32.0",
"@opentelemetry/sdk-trace-node": "^1.0.0",
"@opentelemetry/sdk-trace-base": "^1.0.0",
"mongodb": "^3.5.7"
"mongodb": "^3.7.3"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme",
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"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": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/mongodb-v3.test.ts'",
"test-new-versions": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**mongodb-v4.test.ts'",
"test-new-versions": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/mongodb-v4**.test.ts'",
"test-all-versions": "tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
Expand Down Expand Up @@ -68,6 +68,7 @@
"typescript": "4.4.4"
},
"dependencies": {
"@opentelemetry/sdk-metrics": "^1.9.1",
"@opentelemetry/instrumentation": "^0.39.1",
"@opentelemetry/semantic-conventions": "^1.0.0"
},
Expand Down
Loading

0 comments on commit 988e1f8

Please sign in to comment.