From 5f5f0d37c1b74610957bb4b56a89e71e10cd3c65 Mon Sep 17 00:00:00 2001 From: Chi Ma Date: Thu, 6 Jul 2023 14:37:53 +0700 Subject: [PATCH 1/2] chore: update lerna to v7 and migrate to npm workspace --- .github/workflows/lint.yml | 28 +++--- .github/workflows/release-please.yml | 1 - .github/workflows/test-all-versions.push.yml | 1 + .github/workflows/test-all-versions.yml | 41 ++++----- .github/workflows/unit-test.yml | 88 ++++++++----------- .../package.json | 2 +- .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../auto-instrumentations-node/package.json | 1 - .../auto-instrumentations-web/package.json | 1 - package.json | 19 ++-- .../opentelemetry-host-metrics/package.json | 1 - .../package.json | 3 +- .../package.json | 1 - .../opentelemetry-redis-common/package.json | 1 - .../package.json | 2 - .../opentelemetry-sql-common/package.json | 1 - .../opentelemetry-test-utils/package.json | 1 - .../node/instrumentation-amqplib/package.json | 1 - .../instrumentation-dataloader/package.json | 1 - plugins/node/instrumentation-fs/package.json | 1 - .../instrumentation-lru-memoizer/.tav.yml | 3 - .../instrumentation-lru-memoizer/package.json | 1 - .../instrumentation-mongoose/package.json | 1 - .../instrumentation-socket.io/package.json | 1 - plugins/node/instrumentation-tedious/.tav.yml | 3 - .../node/instrumentation-tedious/package.json | 1 - .../package.json | 1 - .../.tav.yml | 6 -- .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../examples/package.json | 2 +- .../package.json | 1 - .../package.json | 1 - .../src/utils.ts | 1 + .../package.json | 1 - .../package.json | 1 - .../package.json | 3 +- .../.tav.yml | 3 - .../package.json | 3 +- .../package.json | 1 - .../examples/package.json | 2 +- .../package.json | 1 - .../package.json | 1 - .../.tav.yml | 3 - .../examples/package.json | 2 +- .../package.json | 1 - .../examples/package.json | 2 +- .../package.json | 1 - .../.tav.yml | 6 -- .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../opentelemetry-instrumentation-pg/.tav.yml | 1 - .../package.json | 1 - .../.tav.yml | 4 - .../package.json | 1 - .../.tav.yml | 3 - .../package.json | 3 +- .../.tav.yml | 3 - .../examples/package.json | 2 +- .../package.json | 3 +- .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 1 - .../package.json | 4 +- .../tsconfig.esm.json | 1 - .../package.json | 1 - .../src/internal-types.ts | 1 + .../tsconfig.esm.json | 1 - .../tsconfig.json | 1 - .../package.json | 1 - .../package.json | 3 +- .../package.json | 1 - .../package.json | 3 +- .../package.json | 3 +- scripts/update-core-deps.js | 2 +- 85 files changed, 99 insertions(+), 210 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b7fc1072a3..37b1ddea58 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - feat-lerna-bootstrap-deprecate pull_request: jobs: @@ -21,26 +22,21 @@ jobs: ignore: "./**/CHANGELOG.md" args: "./**/*.md" - - name: restore lerna - uses: actions/cache@master # must use unreleased master to cache multiple paths - id: cache + - uses: actions/setup-node@v3 with: - path: | - ./node_modules - ./package-lock.json - node_modules - detectors/node/*/node_modules - metapackages/*/node_modules - packages/*/node_modules - plugins/node/*/node_modules - plugins/web/*/node_modules - propagators/*/node_modules - key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} + node-version: ${{ matrix.node }} + cache: 'npm' + cache-dependency-path: | + package.json + detectors/node/*/package.json + metapackages/*/package.json + packages/*/package.json + plugins/node/*/package.json + plugins/web/*/package.json + propagators/*/package.json - name: Bootstrap - if: steps.cache.outputs.cache-hit != 'true' run: | npm install --only=dev --ignore-scripts - npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --nohoist='gts' --ignore-scripts -- --only=dev - name: Lint run: npm run lint diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6cd76a49ea..dc81fcb06a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -37,7 +37,6 @@ jobs: - name: Build Packages run: | npm install - npx lerna bootstrap --no-ci - uses: google-github-actions/release-please-action@v3 id: release diff --git a/.github/workflows/test-all-versions.push.yml b/.github/workflows/test-all-versions.push.yml index 29702bfd4b..212e4a8360 100644 --- a/.github/workflows/test-all-versions.push.yml +++ b/.github/workflows/test-all-versions.push.yml @@ -5,6 +5,7 @@ on: - "main" - "release/**" - "release-please/**" + - feat-lerna-bootstrap-deprecate jobs: tav: diff --git a/.github/workflows/test-all-versions.yml b/.github/workflows/test-all-versions.yml index 9fefec3147..6ef1dc713b 100644 --- a/.github/workflows/test-all-versions.yml +++ b/.github/workflows/test-all-versions.yml @@ -19,6 +19,9 @@ jobs: fail-fast: false matrix: node: ["14", "16", "18"] + include: + - node: 14 + npm: 7 runs-on: ubuntu-latest services: mongo: @@ -113,33 +116,23 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} + cache: 'npm' + cache-dependency-path: | + package.json + detectors/node/*/package.json + metapackages/*/package.json + packages/*/package.json + plugins/node/*/package.json + plugins/web/*/package.json + propagators/*/package.json + - name: Install minimum npm 7 + if: matrix.npm + run: npm install -g npm@${{matrix.npm}} - name: Set MySQL variables run: mysql --user=root --password=${MYSQL_ROOT_PASSWORD} --host=${MYSQL_HOST} --port=${MYSQL_PORT} -e "SET GLOBAL log_output='TABLE'; SET GLOBAL general_log = 1;" mysql - - name: Cache Dependencies - uses: actions/cache@v3 - with: - path: | - node_modules - package-lock.json - detectors/node/*/node_modules - detectors/node/*/package-lock.json - metapackages/*/node_modules - metapackages/*/package-lock.json - packages/*/node_modules - packages/*/package-lock.json - plugins/node/*/node_modules - plugins/node/*/package-lock.json - plugins/web/*/node_modules - plugins/web/*/package-lock.json - propagators/*/node_modules - propagators/*/package-lock.json - key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package.json', 'detectors/node/*/package.json', 'metapackages/*/package.json', 'packages/*/package.json', 'plugins/node/*/package.json', 'plugins/web/*/package.json', 'propagators/*/package.json') }} - name: Legacy Peer Dependencies for npm 7 - if: matrix.node == '16' run: npm config set legacy-peer-deps=true - name: Install Root Dependencies - run: npm install --ignore-scripts - - name: Bootstrap Dependencies - run: npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --nohoist='mocha' --nohoist='ts-mocha' + run: npm install - name: Run test-all-versions - run: npx lerna run test-all-versions ${{ inputs.lerna-args }} ${{ matrix.lerna-extra-args }} --stream --concurrency 1 + run: npx lerna run --no-bail test-all-versions ${{ inputs.lerna-args }} ${{ matrix.lerna-extra-args }} --stream --concurrency 1 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 654d7a95fa..723f4f1c2b 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,7 +1,8 @@ name: Unit Tests on: push: - branches: [main] + branches: + - feat-lerna-bootstrap-deprecate pull_request: jobs: @@ -13,6 +14,7 @@ jobs: include: - node: 14 code-coverage: true + npm: 7 runs-on: ubuntu-latest services: memcached: @@ -121,40 +123,30 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} + cache: 'npm' + cache-dependency-path: | + package.json + detectors/node/*/package.json + metapackages/*/package.json + packages/*/package.json + plugins/node/*/package.json + plugins/web/*/package.json + propagators/*/package.json + - name: Install minimum npm 7 + if: matrix.npm + run: npm install -g npm@${{matrix.npm}} - name: Set MySQL variables run: mysql --user=root --password=${MYSQL_ROOT_PASSWORD} --host=${MYSQL_HOST} --port=${MYSQL_PORT} -e "SET GLOBAL log_output='TABLE'; SET GLOBAL general_log = 1;" mysql - - name: Cache Dependencies - uses: actions/cache@v3 - with: - path: | - node_modules - package-lock.json - detectors/node/*/node_modules - detectors/node/*/package-lock.json - metapackages/*/node_modules - metapackages/*/package-lock.json - packages/*/node_modules - packages/*/package-lock.json - plugins/node/*/node_modules - plugins/node/*/package-lock.json - plugins/web/*/node_modules - plugins/web/*/package-lock.json - propagators/*/node_modules - propagators/*/package-lock.json - key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('package.json', 'detectors/node/*/package.json', 'metapackages/*/package.json', 'packages/*/package.json', 'plugins/node/*/package.json', 'plugins/web/*/package.json', 'propagators/*/package.json') }} - name: Legacy Peer Dependencies for npm 7 - if: matrix.node == '16' run: npm config set legacy-peer-deps=true - - name: Install Root Dependencies - run: npm install --ignore-scripts - - name: Bootstrap Dependencies - run: npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --nohoist='mocha' --nohoist='ts-mocha' + - name: Install Dependencies + run: npm install - name: Unit tests (Full) if: matrix.code-coverage - run: npm run test -- ${{ matrix.lerna-extra-args }} + run: npx lerna run test ${{ matrix.lerna-extra-args }} - name: Unit tests (Delta) if: ${{ !matrix.code-coverage }} - run: npm run test:ci:changed -- ${{ matrix.lerna-extra-args }} + run: npx lerna run test ${{ matrix.lerna-extra-args }} --since origin/main - name: Build examples run: npm run compile:examples - name: Report Coverage @@ -168,6 +160,9 @@ jobs: fail-fast: false matrix: node: ["14"] + include: + - node: 14 + npm: 7 runs-on: ubuntu-latest env: NPM_CONFIG_UNSAFE_PERM: true @@ -180,31 +175,24 @@ jobs: - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - - name: Cache Dependencies - uses: actions/cache@v3 - with: - path: | - node_modules - package-lock.json - detectors/node/*/node_modules - detectors/node/*/package-lock.json - metapackages/*/node_modules - metapackages/*/package-lock.json - packages/*/node_modules - packages/*/package-lock.json - plugins/node/*/node_modules - plugins/node/*/package-lock.json - plugins/web/*/node_modules - plugins/web/*/package-lock.json - propagators/*/node_modules - propagators/*/package-lock.json - key: ${{ runner.os }}${{ matrix.node }}-browser-${{ hashFiles('package.json', 'detectors/node/*/package.json', 'metapackages/*/package.json', 'packages/*/package.json', 'plugins/node/*/package.json', 'plugins/web/*/package.json', 'propagators/*/package.json') }} + cache: 'npm' + cache-dependency-path: | + package.json + detectors/node/*/package.json + metapackages/*/package.json + packages/*/package.json + plugins/node/*/package.json + plugins/web/*/package.json + propagators/*/package.json + - name: Install minimum npm@${{matrix.npm}} + if: matrix.npm + run: npm install -g npm@${{matrix.npm}} + - name: Legacy Peer Dependencies for npm>7 + run: npm config set legacy-peer-deps=true - name: Install Root Dependencies - run: npm install --ignore-scripts - - name: Bootstrap Dependencies - run: npx lerna bootstrap --no-ci + run: npm install --legacy-bundling - name: Unit tests - run: npm run test:browser + run: npx lerna run --no-bail test:browser - name: Report Coverage uses: codecov/codecov-action@v3 with: diff --git a/archive/opentelemetry-browser-extension-autoinjection/package.json b/archive/opentelemetry-browser-extension-autoinjection/package.json index 1efd629ff2..77e1eab553 100644 --- a/archive/opentelemetry-browser-extension-autoinjection/package.json +++ b/archive/opentelemetry-browser-extension-autoinjection/package.json @@ -35,7 +35,7 @@ "@types/mocha": "8.2.3", "@types/react": "17.0.16", "@types/react-dom": "18.0.2", - "@types/sinon": "10.0.2", + "@types/sinon": "10.0.15", "@types/sinon-chrome": "2.2.11", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1", diff --git a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json index e6bd34924f..35c95952d8 100644 --- a/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json +++ b/detectors/node/opentelemetry-resource-detector-alibaba-cloud/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-alibaba-cloud --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "watch": "tsc -w" diff --git a/detectors/node/opentelemetry-resource-detector-aws/package.json b/detectors/node/opentelemetry-resource-detector-aws/package.json index c1e52afb93..f02087c305 100644 --- a/detectors/node/opentelemetry-resource-detector-aws/package.json +++ b/detectors/node/opentelemetry-resource-detector-aws/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-aws --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "watch": "tsc -w" diff --git a/detectors/node/opentelemetry-resource-detector-container/package.json b/detectors/node/opentelemetry-resource-detector-container/package.json index 19c95d285d..50c8d7ece4 100644 --- a/detectors/node/opentelemetry-resource-detector-container/package.json +++ b/detectors/node/opentelemetry-resource-detector-container/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/resource-detector-container --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "version:update": "node ../../../scripts/version-update.js", diff --git a/detectors/node/opentelemetry-resource-detector-gcp/package.json b/detectors/node/opentelemetry-resource-detector-gcp/package.json index 7d53bacca0..4a7bc66daf 100644 --- a/detectors/node/opentelemetry-resource-detector-gcp/package.json +++ b/detectors/node/opentelemetry-resource-detector-gcp/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-gcp --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "watch": "tsc -w" diff --git a/detectors/node/opentelemetry-resource-detector-github/package.json b/detectors/node/opentelemetry-resource-detector-github/package.json index 36af2ffce2..58c30d9e52 100644 --- a/detectors/node/opentelemetry-resource-detector-github/package.json +++ b/detectors/node/opentelemetry-resource-detector-github/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-github --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "watch": "tsc -w" diff --git a/detectors/node/opentelemetry-resource-detector-instana/package.json b/detectors/node/opentelemetry-resource-detector-instana/package.json index 35fb4e0cdc..c85df98f98 100644 --- a/detectors/node/opentelemetry-resource-detector-instana/package.json +++ b/detectors/node/opentelemetry-resource-detector-instana/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-instana --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "tdd": "npm run test -- --watch-extensions ts --watch", "watch": "tsc -w" diff --git a/metapackages/auto-instrumentations-node/package.json b/metapackages/auto-instrumentations-node/package.json index 4b82be75b6..656b4c3f96 100644 --- a/metapackages/auto-instrumentations-node/package.json +++ b/metapackages/auto-instrumentations-node/package.json @@ -25,7 +25,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/auto-instrumentations-node --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "yarn test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'", "watch": "tsc -w" diff --git a/metapackages/auto-instrumentations-web/package.json b/metapackages/auto-instrumentations-web/package.json index 79836489d3..6b8e0779ba 100644 --- a/metapackages/auto-instrumentations-web/package.json +++ b/metapackages/auto-instrumentations-web/package.json @@ -22,7 +22,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/auto-instrumentations-web --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test:browser": "nyc karma start --single-run", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, diff --git a/package.json b/package.json index ad0e87338c..a8d9ebee5e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "types": "build/src/index.d.ts", "scripts": { "clean": "lerna run clean", - "postinstall": "npm run bootstrap", + "postinstall": "lerna run compile", "prepare": "husky install", "precompile": "tsc --version && npm run version:update", "version:update": "lerna run version:update", @@ -23,15 +23,12 @@ "test": "lerna run test", "test:ci:changed": "lerna run test --since origin/main", "test:browser": "lerna run test:browser --concurrency 1", - "bootstrap": "lerna bootstrap --no-ci", "bump": "lerna publish", "changelog": "lerna-changelog", - "lerna:link": "lerna link", "lint": "lerna run lint", "lint:fix": "lerna run lint:fix", "lint:examples": "eslint ./examples/**/*.js", - "lint:examples:fix": "eslint ./examples/**/*.js --fix", - "lerna:scope": "lerna bootstrap --include-dependents --include-dependencies --scope" + "lint:examples:fix": "eslint ./examples/**/*.js --fix" }, "keywords": [ "opentelemetry", @@ -56,11 +53,21 @@ "eslint-plugin-node": "11.1.0", "eslint-plugin-prettier": "4.2.1", "husky": "7.0.4", - "lerna": "5.5.2", + "lerna": "7.1.1", "lerna-changelog": "2.2.0", "prettier": "2.8.8", "typescript": "4.4.4" }, + "workspaces": [ + "packages/*", + "metapackages/*", + "plugins/node/*", + "plugins/node/*/examples", + "plugins/web/*", + "plugins/web/*/examples", + "propagators/*", + "detectors/node/*" + ], "changelog": { "labels": { "breaking": ":boom: Breaking Change", diff --git a/packages/opentelemetry-host-metrics/package.json b/packages/opentelemetry-host-metrics/package.json index cbfaaf787d..5b1abff53e 100644 --- a/packages/opentelemetry-host-metrics/package.json +++ b/packages/opentelemetry-host-metrics/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/host-metrics --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", "version:update": "node ../../scripts/version-update.js", diff --git a/packages/opentelemetry-id-generator-aws-xray/package.json b/packages/opentelemetry-id-generator-aws-xray/package.json index 71cd335ae1..eb834ec9d1 100644 --- a/packages/opentelemetry-id-generator-aws-xray/package.json +++ b/packages/opentelemetry-id-generator-aws-xray/package.json @@ -23,8 +23,7 @@ "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile" + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/packages/opentelemetry-propagation-utils/package.json b/packages/opentelemetry-propagation-utils/package.json index 435f11f846..385e603120 100644 --- a/packages/opentelemetry-propagation-utils/package.json +++ b/packages/opentelemetry-propagation-utils/package.json @@ -13,7 +13,6 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/propagation-utils --include-dependencies", - "prepare": "npm run compile", "prewatch": "npm run precompile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", diff --git a/packages/opentelemetry-redis-common/package.json b/packages/opentelemetry-redis-common/package.json index a90cc8aa6a..59c93aacf6 100644 --- a/packages/opentelemetry-redis-common/package.json +++ b/packages/opentelemetry-redis-common/package.json @@ -13,7 +13,6 @@ "compile": "tsc --build tsconfig.json", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/redis-common --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "watch": "tsc -w" }, diff --git a/packages/opentelemetry-sampler-aws-xray/package.json b/packages/opentelemetry-sampler-aws-xray/package.json index afb90e1707..fc58ef413a 100644 --- a/packages/opentelemetry-sampler-aws-xray/package.json +++ b/packages/opentelemetry-sampler-aws-xray/package.json @@ -34,7 +34,6 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/sampler-aws-xray --include-dependencies", "prewatch": "npm run precompile", "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "version:update": "node ../../scripts/version-update.js", @@ -63,7 +62,6 @@ "ts-mocha": "10.0.0", "nyc": "15.1.0", "typescript": "4.4.4", - "gts": "3.1.1", "@typescript-eslint/eslint-plugin": "5.8.1", "@typescript-eslint/parser": "5.8.1" }, diff --git a/packages/opentelemetry-sql-common/package.json b/packages/opentelemetry-sql-common/package.json index 666efaf3bd..c61b33db88 100644 --- a/packages/opentelemetry-sql-common/package.json +++ b/packages/opentelemetry-sql-common/package.json @@ -13,7 +13,6 @@ "compile": "tsc --build tsconfig.json", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/sql-common --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "watch": "tsc -w" }, diff --git a/packages/opentelemetry-test-utils/package.json b/packages/opentelemetry-test-utils/package.json index 3995735c51..7486706936 100644 --- a/packages/opentelemetry-test-utils/package.json +++ b/packages/opentelemetry-test-utils/package.json @@ -13,7 +13,6 @@ "compile": "tsc -p .", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/contrib-test-utils --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "watch": "tsc -w" }, "repository": "open-telemetry/opentelemetry-js-contrib", diff --git a/plugins/node/instrumentation-amqplib/package.json b/plugins/node/instrumentation-amqplib/package.json index 3505cbb613..b38c62073a 100644 --- a/plugins/node/instrumentation-amqplib/package.json +++ b/plugins/node/instrumentation-amqplib/package.json @@ -34,7 +34,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/instrumentation-amqplib --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/instrumentation-dataloader/package.json b/plugins/node/instrumentation-dataloader/package.json index 590b3886fa..45454814d6 100644 --- a/plugins/node/instrumentation-dataloader/package.json +++ b/plugins/node/instrumentation-dataloader/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-dataloader --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/instrumentation-fs/package.json b/plugins/node/instrumentation-fs/package.json index 4361e87fec..549e3ca291 100644 --- a/plugins/node/instrumentation-fs/package.json +++ b/plugins/node/instrumentation-fs/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/instrumentation-fs --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc -p ." }, diff --git a/plugins/node/instrumentation-lru-memoizer/.tav.yml b/plugins/node/instrumentation-lru-memoizer/.tav.yml index 6402081ee1..bf8a138d1b 100644 --- a/plugins/node/instrumentation-lru-memoizer/.tav.yml +++ b/plugins/node/instrumentation-lru-memoizer/.tav.yml @@ -2,6 +2,3 @@ versions: ">=1.3 <3" commands: - npm test - - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/instrumentation-lru-memoizer/package.json b/plugins/node/instrumentation-lru-memoizer/package.json index ceccfb35ea..deaea88df8 100644 --- a/plugins/node/instrumentation-lru-memoizer/package.json +++ b/plugins/node/instrumentation-lru-memoizer/package.json @@ -14,7 +14,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/instrumentation-lru-memoizer --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc -p ." }, diff --git a/plugins/node/instrumentation-mongoose/package.json b/plugins/node/instrumentation-mongoose/package.json index 5f320f246f..684a02cf0d 100644 --- a/plugins/node/instrumentation-mongoose/package.json +++ b/plugins/node/instrumentation-mongoose/package.json @@ -15,7 +15,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/instrumentation-mongoose --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc -p ." }, diff --git a/plugins/node/instrumentation-socket.io/package.json b/plugins/node/instrumentation-socket.io/package.json index 1e64ffb84a..4135f31f64 100644 --- a/plugins/node/instrumentation-socket.io/package.json +++ b/plugins/node/instrumentation-socket.io/package.json @@ -14,7 +14,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version --scope @opentelemetry/instrumentation-socket.io --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc -p ." }, diff --git a/plugins/node/instrumentation-tedious/.tav.yml b/plugins/node/instrumentation-tedious/.tav.yml index 22db589193..2ebfd15136 100644 --- a/plugins/node/instrumentation-tedious/.tav.yml +++ b/plugins/node/instrumentation-tedious/.tav.yml @@ -2,6 +2,3 @@ tedious: # 4.0.0 is broken: https://github.com/tediousjs/tedious/commit/4eceb48 versions: "1.11.0 || 1.14.0 || 2.7.1 || 3.0.1 || 4.2.0 || ^6.7.0 || 8.3.0 || 9.2.3 || 11.0.9 || 11.2.0 || 11.4.0 || ^11.8.0 || ^12.3.0 || ^13.2.0 || ^14.0.0" commands: npm run test - - # Fix missing `test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/instrumentation-tedious/package.json b/plugins/node/instrumentation-tedious/package.json index b9c4219a8c..8c7337d17a 100644 --- a/plugins/node/instrumentation-tedious/package.json +++ b/plugins/node/instrumentation-tedious/package.json @@ -12,7 +12,6 @@ "lint": "eslint . --ext .ts", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-tedious --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json index 415d231a3f..de77ff3eb1 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-aws-lambda --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml b/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml index d905375e40..565fc7382f 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/.tav.yml @@ -4,19 +4,13 @@ versions: ">=2.1266.0 || 2.1262.0 || 2.1219.0 || 2.1048.0 || 2.1012.0 || 2.647.0 || 2.308.0" commands: - npm run test - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link "@aws-sdk/client-s3": versions: ">=3.223.0 || 3.218.0 || 3.216.0 || 3.154.0 || 3.107.0 || 3.54.0 || 3.6.1" commands: - npm run test - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link "@aws-sdk/client-sqs": versions: ">=3.216.0 || 3.171.0 || 3.58.0 || 3.54.0 || 3.43.0 || 3.24.0" commands: - npm run test - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json index 7a382575e5..a7fc879630 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/package.json @@ -35,7 +35,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-aws-sdk --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json --require '@opentelemetry/contrib-test-utils' 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/package.json b/plugins/node/opentelemetry-instrumentation-bunyan/package.json index 70f8d8e6a0..3c81c50e34 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/package.json +++ b/plugins/node/opentelemetry-instrumentation-bunyan/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-bunyan --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/opentelemetry-instrumentation-cassandra/package.json b/plugins/node/opentelemetry-instrumentation-cassandra/package.json index 82b5e743b1..257b185277 100644 --- a/plugins/node/opentelemetry-instrumentation-cassandra/package.json +++ b/plugins/node/opentelemetry-instrumentation-cassandra/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-cassandra-driver --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/node/opentelemetry-instrumentation-connect/package.json b/plugins/node/opentelemetry-instrumentation-connect/package.json index 81adf97d4d..1e41d37fe2 100644 --- a/plugins/node/opentelemetry-instrumentation-connect/package.json +++ b/plugins/node/opentelemetry-instrumentation-connect/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-connect --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "version:update": "node ../../../scripts/version-update.js", "watch": "tsc -w" diff --git a/plugins/node/opentelemetry-instrumentation-dns/package.json b/plugins/node/opentelemetry-instrumentation-dns/package.json index 0f6f627514..62eabf387d 100644 --- a/plugins/node/opentelemetry-instrumentation-dns/package.json +++ b/plugins/node/opentelemetry-instrumentation-dns/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-dns --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/node/opentelemetry-instrumentation-express/examples/package.json b/plugins/node/opentelemetry-instrumentation-express/examples/package.json index c829a5ac71..8ac6a69154 100644 --- a/plugins/node/opentelemetry-instrumentation-express/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-express/examples/package.json @@ -33,7 +33,7 @@ "@opentelemetry/exporter-jaeger": "^1.0.0", "@opentelemetry/exporter-zipkin": "^1.0.0", "@opentelemetry/instrumentation": "^0.41.2", - "@opentelemetry/instrumentation-express": "0.28.0", + "@opentelemetry/instrumentation-express": "0.33.0", "@opentelemetry/instrumentation-http": "^0.41.2", "@opentelemetry/resources": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", diff --git a/plugins/node/opentelemetry-instrumentation-express/package.json b/plugins/node/opentelemetry-instrumentation-express/package.json index 77de1e3131..e9521a668c 100644 --- a/plugins/node/opentelemetry-instrumentation-express/package.json +++ b/plugins/node/opentelemetry-instrumentation-express/package.json @@ -17,7 +17,6 @@ "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", "compile:examples": "cd examples && npm run compile", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-fastify/package.json b/plugins/node/opentelemetry-instrumentation-fastify/package.json index 65c8c2cc8c..7936cd0f45 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/package.json +++ b/plugins/node/opentelemetry-instrumentation-fastify/package.json @@ -11,7 +11,6 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-fastify --include-dependencies", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "version:update": "node ../../../scripts/version-update.js", "prewatch": "npm run precompile", diff --git a/plugins/node/opentelemetry-instrumentation-fastify/src/utils.ts b/plugins/node/opentelemetry-instrumentation-fastify/src/utils.ts index 0ff05492a3..35b5644509 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-fastify/src/utils.ts @@ -42,6 +42,7 @@ export function startSpan( const spans: Span[] = reply[spanRequestSymbol] || []; spans.push(span); + // eslint-disable-next-line @typescript-eslint/no-floating-promises -- as reply have then method, Object.defineProperty(reply) will also return a promise like object Object.defineProperty(reply, spanRequestSymbol, { enumerable: false, configurable: true, diff --git a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json index f892564893..49f43f9c97 100644 --- a/plugins/node/opentelemetry-instrumentation-generic-pool/package.json +++ b/plugins/node/opentelemetry-instrumentation-generic-pool/package.json @@ -15,7 +15,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-graphql/package.json b/plugins/node/opentelemetry-instrumentation-graphql/package.json index 7f76139977..02576d6486 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/package.json +++ b/plugins/node/opentelemetry-instrumentation-graphql/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-graphql --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", "tdd": "npm run test -- --watch-extensions ts --watch", diff --git a/plugins/node/opentelemetry-instrumentation-hapi/package.json b/plugins/node/opentelemetry-instrumentation-hapi/package.json index 464fca8502..3093c67b4a 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/package.json +++ b/plugins/node/opentelemetry-instrumentation-hapi/package.json @@ -14,8 +14,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-hapi --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "tsc -p .", - "prepare": "npm run compile" + "compile": "tsc -p ." }, "keywords": [ "hapi", diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/.tav.yml b/plugins/node/opentelemetry-instrumentation-ioredis/.tav.yml index 29bd4413db..754f4359db 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-ioredis/.tav.yml @@ -2,6 +2,3 @@ ioredis: # Ignoring v4.19.0. Tests never ends. Caused by https://github.com/luin/ioredis/pull/1219 versions: "^2.5.0 || ^3.2.2 || 4.14.1 || 4.16.3 || 4.17.3 || 4.18.0 || 4.19.2 || 4.19.4 || 4.22.0 || 4.24.5 || 4.26.0 || 4.27.2 || ^4.27.6 || 5.0.4 || ^5.2.4" commands: npm run test - - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/package.json b/plugins/node/opentelemetry-instrumentation-ioredis/package.json index d5232bd687..5d8d509bbf 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/package.json +++ b/plugins/node/opentelemetry-instrumentation-ioredis/package.json @@ -18,8 +18,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-ioredis --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "tsc -p .", - "prepare": "npm run compile" + "compile": "tsc -p ." }, "keywords": [ "instrumentation", diff --git a/plugins/node/opentelemetry-instrumentation-knex/package.json b/plugins/node/opentelemetry-instrumentation-knex/package.json index 687e6f4ef4..cddb63708f 100644 --- a/plugins/node/opentelemetry-instrumentation-knex/package.json +++ b/plugins/node/opentelemetry-instrumentation-knex/package.json @@ -15,7 +15,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-koa/examples/package.json b/plugins/node/opentelemetry-instrumentation-koa/examples/package.json index 4c21e26897..4d657014f2 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-koa/examples/package.json @@ -36,7 +36,7 @@ "@opentelemetry/exporter-zipkin": "^1.0.0", "@opentelemetry/instrumentation": "^0.41.2", "@opentelemetry/instrumentation-http": "^0.41.2", - "@opentelemetry/instrumentation-koa": "^0.31.0", + "@opentelemetry/instrumentation-koa": "^0.35.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", "axios": "^0.21.1", diff --git a/plugins/node/opentelemetry-instrumentation-koa/package.json b/plugins/node/opentelemetry-instrumentation-koa/package.json index 7332fa4c26..a152f9fec4 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/package.json +++ b/plugins/node/opentelemetry-instrumentation-koa/package.json @@ -17,7 +17,6 @@ "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", "compile:examples": "cd examples && npm run compile", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-memcached/package.json b/plugins/node/opentelemetry-instrumentation-memcached/package.json index 2454c18ce2..b509a5bfd8 100644 --- a/plugins/node/opentelemetry-instrumentation-memcached/package.json +++ b/plugins/node/opentelemetry-instrumentation-memcached/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-memcached --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test:debug": "cross-env RUN_MEMCACHED_TESTS_LOCAL=true ts-mocha --inspect-brk --no-timeouts -p tsconfig.json 'test/**/*.test.ts'", diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/.tav.yml b/plugins/node/opentelemetry-instrumentation-mongodb/.tav.yml index 86a2bf927d..296530bb9d 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-mongodb/.tav.yml @@ -6,6 +6,3 @@ mongodb: commands: npm run test-v4 - versions: ">=5 <6" commands: npm run test-v5 - - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json index 3b4f670047..6bd40b300c 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json @@ -35,7 +35,7 @@ "@opentelemetry/exporter-zipkin": "^1.0.0", "@opentelemetry/instrumentation": "^0.41.2", "@opentelemetry/instrumentation-http": "^0.41.2", - "@opentelemetry/instrumentation-mongodb": "^0.32.0", + "@opentelemetry/instrumentation-mongodb": "^0.36.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", "mongodb": "^3.7.3" diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/package.json index 241426f8fa..aad9e8f3f2 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/package.json @@ -21,7 +21,6 @@ "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", "compile:examples": "cd examples && npm run compile", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-mysql/examples/package.json b/plugins/node/opentelemetry-instrumentation-mysql/examples/package.json index 698bd86aa5..bf45e3c373 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql/examples/package.json @@ -36,7 +36,7 @@ "@opentelemetry/exporter-zipkin": "^1.0.0", "@opentelemetry/instrumentation": "^0.41.2", "@opentelemetry/instrumentation-http": "^0.41.2", - "@opentelemetry/instrumentation-mysql": "^0.31.0", + "@opentelemetry/instrumentation-mysql": "^0.34.0", "@opentelemetry/sdk-trace-base": "^1.0.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/exporter-metrics-otlp-grpc": "0.41.2", diff --git a/plugins/node/opentelemetry-instrumentation-mysql/package.json b/plugins/node/opentelemetry-instrumentation-mysql/package.json index d9a09e3f27..b8211efa98 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql/package.json @@ -12,7 +12,6 @@ "lint": "eslint . --ext .ts", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-mysql --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha tsconfig.json 'test/**/*.test.ts'", "version:update": "node ../../../scripts/version-update.js", diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/.tav.yml b/plugins/node/opentelemetry-instrumentation-mysql2/.tav.yml index 3afbb89977..22de7dc8a8 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-mysql2/.tav.yml @@ -1,18 +1,12 @@ mysql2: - versions: <4 >=3.2.0 || 3.1.0 || 3.0.0 commands: npm run test - # Fix missing `test-utils` package - pretest: npm run --prefix ../../../ lerna:link - versions: <3 >=2.3.2 || 2.3.0 || 2.2.5 || 2.1.0 # Skip 2.3.3 which installs types from git which takes 10m on it's own commands: npm run test - # Fix missing `test-utils` package - pretest: npm run --prefix ../../../ lerna:link - versions: 1.4.2 || 1.5.3 || 1.6.4 || 1.6.5 || 1.7.0 # Skip v1.6.2, which is broken commands: npm run test - # Fix missing `test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/package.json b/plugins/node/opentelemetry-instrumentation-mysql2/package.json index 423274ead7..777d10e8d5 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql2/package.json @@ -12,7 +12,6 @@ "lint": "eslint . --ext .ts", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-mysql2 --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json index 7777b1b293..7d24e761b5 100644 --- a/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json +++ b/plugins/node/opentelemetry-instrumentation-nestjs-core/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-nestjs-core --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha --timeout 5000 -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "tav", diff --git a/plugins/node/opentelemetry-instrumentation-net/package.json b/plugins/node/opentelemetry-instrumentation-net/package.json index 82584add10..05e73ac5a7 100644 --- a/plugins/node/opentelemetry-instrumentation-net/package.json +++ b/plugins/node/opentelemetry-instrumentation-net/package.json @@ -13,7 +13,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-net --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/node/opentelemetry-instrumentation-pg/.tav.yml b/plugins/node/opentelemetry-instrumentation-pg/.tav.yml index fa1d669474..9f9320f8d5 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-pg/.tav.yml @@ -2,5 +2,4 @@ pg: # a sample from supported versions - versions: "8.5.1 || 8.6.0 || 8.7.1" peerDependencies: pg-pool@^3 - pretest: npm run --prefix ../../../ lerna:link commands: npm run test diff --git a/plugins/node/opentelemetry-instrumentation-pg/package.json b/plugins/node/opentelemetry-instrumentation-pg/package.json index 03caf54269..f37e72e1a5 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/package.json +++ b/plugins/node/opentelemetry-instrumentation-pg/package.json @@ -12,7 +12,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-pg --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "tdd": "npm run test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", "test-all-versions": "cross-env IN_TAV=true tav", diff --git a/plugins/node/opentelemetry-instrumentation-pino/.tav.yml b/plugins/node/opentelemetry-instrumentation-pino/.tav.yml index 5ff15066e0..c23dab2f53 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-pino/.tav.yml @@ -3,11 +3,7 @@ pino: node: ">=14" commands: npm run test - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link - versions: "^7.11.0 || 7.8.0 || 7.2.0 || ^6.13.1 || 5.17.0 || 5.14.0" node: ">=8 <14" commands: npm run test - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-pino/package.json b/plugins/node/opentelemetry-instrumentation-pino/package.json index fbca6c4d77..c29014d6ef 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/package.json +++ b/plugins/node/opentelemetry-instrumentation-pino/package.json @@ -14,7 +14,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-pino --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/.tav.yml b/plugins/node/opentelemetry-instrumentation-redis-4/.tav.yml index f478be1116..0940b952ff 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-redis-4/.tav.yml @@ -3,6 +3,3 @@ redis: jobs: - versions: "^4.0.0" commands: npm run test - - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/package.json b/plugins/node/opentelemetry-instrumentation-redis-4/package.json index 84e65f16da..73b271ae23 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis-4/package.json @@ -20,8 +20,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-redis-4 --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "tsc -p .", - "prepare": "npm run compile" + "compile": "tsc -p ." }, "keywords": [ "instrumentation", diff --git a/plugins/node/opentelemetry-instrumentation-redis/.tav.yml b/plugins/node/opentelemetry-instrumentation-redis/.tav.yml index d22ee83fdf..c6b5a4154f 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/.tav.yml +++ b/plugins/node/opentelemetry-instrumentation-redis/.tav.yml @@ -1,6 +1,3 @@ redis: versions: ^2.6.0 || ^3.0.0 commands: npm run test - - # Fix missing `contrib-test-utils` package - pretest: npm run --prefix ../../../ lerna:link diff --git a/plugins/node/opentelemetry-instrumentation-redis/examples/package.json b/plugins/node/opentelemetry-instrumentation-redis/examples/package.json index 3d6c759807..3fe38fd502 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/examples/package.json @@ -36,7 +36,7 @@ "@opentelemetry/exporter-zipkin": "^1.0.0", "@opentelemetry/instrumentation": "^0.41.2", "@opentelemetry/instrumentation-http": "^0.41.2", - "@opentelemetry/instrumentation-redis": "^0.32.0", + "@opentelemetry/instrumentation-redis": "^0.35.0", "@opentelemetry/sdk-trace-base": "^1.0.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "axios": "^0.21.1", diff --git a/plugins/node/opentelemetry-instrumentation-redis/package.json b/plugins/node/opentelemetry-instrumentation-redis/package.json index 114097676d..2fc53f0442 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/package.json +++ b/plugins/node/opentelemetry-instrumentation-redis/package.json @@ -21,8 +21,7 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", - "compile:examples": "cd examples && npm run compile", - "prepare": "npm run compile" + "compile:examples": "cd examples && npm run compile" }, "keywords": [ "instrumentation", diff --git a/plugins/node/opentelemetry-instrumentation-restify/package.json b/plugins/node/opentelemetry-instrumentation-restify/package.json index 10f36902ab..66ecb20db3 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/package.json +++ b/plugins/node/opentelemetry-instrumentation-restify/package.json @@ -11,7 +11,6 @@ "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-restify --include-dependencies", - "prepare": "npm run compile", "prewatch": "npm run precompile", "tdd": "yarn test -- --watch-extensions ts --watch", "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'", diff --git a/plugins/node/opentelemetry-instrumentation-router/package.json b/plugins/node/opentelemetry-instrumentation-router/package.json index 8b0a049242..0d12c4b042 100644 --- a/plugins/node/opentelemetry-instrumentation-router/package.json +++ b/plugins/node/opentelemetry-instrumentation-router/package.json @@ -15,7 +15,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p .", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/plugins/node/opentelemetry-instrumentation-winston/package.json b/plugins/node/opentelemetry-instrumentation-winston/package.json index 713fd7c897..7e9994c1ba 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/package.json +++ b/plugins/node/opentelemetry-instrumentation-winston/package.json @@ -14,7 +14,6 @@ "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-winston --include-dependencies", "prewatch": "npm run precompile", - "prepare": "npm run compile", "version:update": "node ../../../scripts/version-update.js", "compile": "tsc -p ." }, diff --git a/plugins/web/opentelemetry-instrumentation-document-load/package.json b/plugins/web/opentelemetry-instrumentation-document-load/package.json index 3abf89be2a..303ebd9c7b 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/package.json +++ b/plugins/web/opentelemetry-instrumentation-document-load/package.json @@ -14,7 +14,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", "watch": "tsc --build -watch tsconfig.json tsconfig.esm.json" diff --git a/plugins/web/opentelemetry-instrumentation-long-task/package.json b/plugins/web/opentelemetry-instrumentation-long-task/package.json index b78a6af9c6..c0e9608653 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/package.json +++ b/plugins/web/opentelemetry-instrumentation-long-task/package.json @@ -14,7 +14,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" @@ -73,8 +72,7 @@ "typescript": "4.4.4", "webpack": "4.46.0", "webpack-cli": "4.7.2", - "webpack-merge": "5.8.0", - "zone.js": "0.11.4" + "webpack-merge": "5.8.0" }, "dependencies": { "@opentelemetry/core": "^1.8.0", diff --git a/plugins/web/opentelemetry-instrumentation-long-task/tsconfig.esm.json b/plugins/web/opentelemetry-instrumentation-long-task/tsconfig.esm.json index d903fa3086..379f547a46 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/tsconfig.esm.json +++ b/plugins/web/opentelemetry-instrumentation-long-task/tsconfig.esm.json @@ -5,7 +5,6 @@ "outDir": "build/esm", "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, - "files": [ "node_modules/zone.js/dist/zone.js.d.ts"], "include": [ "src/**/*.ts" ] diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json index bae6996228..52acc73e4c 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json @@ -14,7 +14,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/src/internal-types.ts b/plugins/web/opentelemetry-instrumentation-user-interaction/src/internal-types.ts index a845906632..61229732ff 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/src/internal-types.ts +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/src/internal-types.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/// import { HrTime } from '@opentelemetry/api'; import { EventName } from './types'; diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.esm.json b/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.esm.json index 0bbc54d329..2eb13ff857 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.esm.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.esm.json @@ -6,7 +6,6 @@ "skipLibCheck": true, "tsBuildInfoFile": "build/esm/tsconfig.esm.tsbuildinfo" }, - "files": [ "node_modules/zone.js/dist/zone.js.d.ts"], "include": [ "src/**/*.ts" ] diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.json b/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.json index ea1dd61b2c..5c3680dd33 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/tsconfig.json @@ -5,7 +5,6 @@ "outDir": "build", "skipLibCheck": true }, - "files": [ "node_modules/zone.js/dist/zone.js.d.ts"], "include": [ "src/**/*.ts", "test/**/*.ts" diff --git a/plugins/web/opentelemetry-plugin-react-load/package.json b/plugins/web/opentelemetry-plugin-react-load/package.json index da73ea9a22..9aa42ebc86 100644 --- a/plugins/web/opentelemetry-plugin-react-load/package.json +++ b/plugins/web/opentelemetry-plugin-react-load/package.json @@ -14,7 +14,6 @@ "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" diff --git a/propagators/opentelemetry-propagator-aws-xray/package.json b/propagators/opentelemetry-propagator-aws-xray/package.json index 7d4fe027cb..6acfcea8a9 100644 --- a/propagators/opentelemetry-propagator-aws-xray/package.json +++ b/propagators/opentelemetry-propagator-aws-xray/package.json @@ -15,8 +15,7 @@ "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile" + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/propagators/opentelemetry-propagator-grpc-census-binary/package.json b/propagators/opentelemetry-propagator-grpc-census-binary/package.json index 44e32383c0..ff46a37c06 100644 --- a/propagators/opentelemetry-propagator-grpc-census-binary/package.json +++ b/propagators/opentelemetry-propagator-grpc-census-binary/package.json @@ -15,7 +15,6 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/propagator-grpc-census-binary --include-dependencies", "prewatch": "npm run precompile", "compile": "tsc -p .", - "prepare": "npm run compile", "watch": "tsc -w" }, "keywords": [ diff --git a/propagators/opentelemetry-propagator-instana/package.json b/propagators/opentelemetry-propagator-instana/package.json index c4290cc404..cf8063d4c8 100644 --- a/propagators/opentelemetry-propagator-instana/package.json +++ b/propagators/opentelemetry-propagator-instana/package.json @@ -15,8 +15,7 @@ "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile" + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/propagators/opentelemetry-propagator-ot-trace/package.json b/propagators/opentelemetry-propagator-ot-trace/package.json index a36c753cd0..b847905974 100644 --- a/propagators/opentelemetry-propagator-ot-trace/package.json +++ b/propagators/opentelemetry-propagator-ot-trace/package.json @@ -15,8 +15,7 @@ "test:browser": "nyc karma start --single-run", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", - "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", - "prepare": "npm run compile" + "watch": "tsc --build --watch tsconfig.json tsconfig.esm.json" }, "keywords": [ "opentelemetry", diff --git a/scripts/update-core-deps.js b/scripts/update-core-deps.js index a16df96317..07aa72061b 100644 --- a/scripts/update-core-deps.js +++ b/scripts/update-core-deps.js @@ -27,7 +27,7 @@ * `CORE_REPOSITORY=../../otel-core node scripts/update-core-deps.js * * Note that this only updates the versions in the package.json for each package - * and you will still need to run `lerna bootstrap` and make any necessary + * and you will still need to run `npm run compile` and make any necessary * code changes. */ From 68fe3cb1f4d3e695390c320c4952f2000afd4e2a Mon Sep 17 00:00:00 2001 From: Chi Ma Date: Sun, 13 Aug 2023 17:01:59 +0700 Subject: [PATCH 2/2] Test mongodb-example by upgrade mongodb version --- .github/workflows/unit-test.yml | 2 ++ .../examples/package.json | 2 +- .../examples/src/utils.ts | 20 ++++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 723f4f1c2b..5589643607 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -130,7 +130,9 @@ jobs: metapackages/*/package.json packages/*/package.json plugins/node/*/package.json + plugins/node/*/examples/package.json plugins/web/*/package.json + plugins/web/*/examples/package.json propagators/*/package.json - name: Install minimum npm 7 if: matrix.npm diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json b/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json index 6bd40b300c..8248d7939e 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json +++ b/plugins/node/opentelemetry-instrumentation-mongodb/examples/package.json @@ -38,7 +38,7 @@ "@opentelemetry/instrumentation-mongodb": "^0.36.0", "@opentelemetry/sdk-trace-node": "^1.0.0", "@opentelemetry/sdk-trace-base": "^1.0.0", - "mongodb": "^3.7.3" + "mongodb": "^4.16.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib#readme", "devDependencies": { diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/examples/src/utils.ts b/plugins/node/opentelemetry-instrumentation-mongodb/examples/src/utils.ts index 350149dcaf..97e3b0937c 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/examples/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/examples/src/utils.ts @@ -28,15 +28,17 @@ export function accessDB( options: mongodb.MongoClientOptions = {} ): Promise { return new Promise((resolve, reject) => { - mongodb.MongoClient.connect(url, { - serverSelectionTimeoutMS: 1000, - useUnifiedTopology: true - }) - .then(client => { - resolve(client.db(dbName)); + try { + const client = new mongodb.MongoClient(url, { + serverSelectionTimeoutMS: 1000 }) - .catch(reason => { - reject(reason); - }); + + const db = client.db(dbName) + + resolve(db) + } catch (reason) { + + reject(reason); + } }); }