From 02c945837e6980e9eb54e647b809c9a25b5b76e8 Mon Sep 17 00:00:00 2001 From: Emil Sivervik Date: Wed, 22 May 2024 02:21:27 +0200 Subject: [PATCH 1/6] docs(instr-ioredis): update ioredis instrumentation link to instrumentation options (#2227) --- plugins/node/opentelemetry-instrumentation-ioredis/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/src/types.ts b/plugins/node/opentelemetry-instrumentation-ioredis/src/types.ts index 5d32116a67..f43849ec52 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/src/types.ts +++ b/plugins/node/opentelemetry-instrumentation-ioredis/src/types.ts @@ -55,7 +55,7 @@ export interface RedisResponseCustomAttributeFunction { } /** - * Options available for the IORedis Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-ioredis#ioredis-instrumentation-options)) + * Options available for the IORedis Instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-ioredis/README.md#ioredis-instrumentation-options)) */ export interface IORedisInstrumentationConfig extends InstrumentationConfig { /** Custom serializer function for the db.statement tag */ From ec618920b9642b17df118c45cd0f0ab0d71507b7 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Wed, 22 May 2024 19:16:00 +0300 Subject: [PATCH 2/6] chore: remove duplicate version update in compile (#2224) --- .../node/opentelemetry-resource-detector-container/package.json | 2 +- plugins/node/instrumentation-amqplib/package.json | 2 +- plugins/node/instrumentation-fs/package.json | 2 +- plugins/node/instrumentation-lru-memoizer/package.json | 2 +- plugins/node/instrumentation-mongoose/package.json | 2 +- plugins/node/instrumentation-socket.io/package.json | 2 +- .../opentelemetry-instrumentation-document-load/package.json | 2 +- .../web/opentelemetry-instrumentation-long-task/package.json | 2 +- .../opentelemetry-instrumentation-user-interaction/package.json | 2 +- plugins/web/opentelemetry-plugin-react-load/package.json | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/detectors/node/opentelemetry-resource-detector-container/package.json b/detectors/node/opentelemetry-resource-detector-container/package.json index 61b3e45616..5b31956c7b 100644 --- a/detectors/node/opentelemetry-resource-detector-container/package.json +++ b/detectors/node/opentelemetry-resource-detector-container/package.json @@ -8,7 +8,7 @@ "scripts": { "clean": "rimraf build/*", "codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../", - "compile": "npm run version:update && tsc -p .", + "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/resource-detector-container --include-dependencies", diff --git a/plugins/node/instrumentation-amqplib/package.json b/plugins/node/instrumentation-amqplib/package.json index 9910feedae..c26cc76170 100644 --- a/plugins/node/instrumentation-amqplib/package.json +++ b/plugins/node/instrumentation-amqplib/package.json @@ -27,7 +27,7 @@ "repository": "open-telemetry/opentelemetry-js-contrib", "scripts": { "clean": "rimraf build/*", - "compile": "npm run version:update && tsc -p .", + "compile": "tsc -p .", "lint": "eslint . --ext .ts", "lint:fix": "eslint . --ext .ts --fix", "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-amqplib --include-dependencies", diff --git a/plugins/node/instrumentation-fs/package.json b/plugins/node/instrumentation-fs/package.json index 9585a038d6..824dfaac4b 100644 --- a/plugins/node/instrumentation-fs/package.json +++ b/plugins/node/instrumentation-fs/package.json @@ -15,7 +15,7 @@ "prewatch": "npm run precompile", "prepublishOnly": "npm run compile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc -p ." + "compile": "tsc -p ." }, "keywords": [ "fs", diff --git a/plugins/node/instrumentation-lru-memoizer/package.json b/plugins/node/instrumentation-lru-memoizer/package.json index 6040807233..dd3b46a81c 100644 --- a/plugins/node/instrumentation-lru-memoizer/package.json +++ b/plugins/node/instrumentation-lru-memoizer/package.json @@ -16,7 +16,7 @@ "prewatch": "npm run precompile", "prepublishOnly": "npm run compile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc -p ." + "compile": "tsc -p ." }, "keywords": [ "lru-memoizer", diff --git a/plugins/node/instrumentation-mongoose/package.json b/plugins/node/instrumentation-mongoose/package.json index dc130c0c01..ab2b70d5b5 100644 --- a/plugins/node/instrumentation-mongoose/package.json +++ b/plugins/node/instrumentation-mongoose/package.json @@ -17,7 +17,7 @@ "prewatch": "npm run precompile", "prepublishOnly": "npm run compile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc -p ." + "compile": "tsc -p ." }, "keywords": [ "mongodb", diff --git a/plugins/node/instrumentation-socket.io/package.json b/plugins/node/instrumentation-socket.io/package.json index 78c0d886f3..58459c97b6 100644 --- a/plugins/node/instrumentation-socket.io/package.json +++ b/plugins/node/instrumentation-socket.io/package.json @@ -16,7 +16,7 @@ "prewatch": "npm run precompile", "prepublishOnly": "npm run compile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc -p ." + "compile": "tsc -p ." }, "keywords": [ "socket.io", diff --git a/plugins/web/opentelemetry-instrumentation-document-load/package.json b/plugins/web/opentelemetry-instrumentation-document-load/package.json index 18c9a8cdda..75ecc372e0 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/package.json +++ b/plugins/web/opentelemetry-instrumentation-document-load/package.json @@ -14,7 +14,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-document-load --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "wtr --watch", "test:browser": "wtr --coverage", diff --git a/plugins/web/opentelemetry-instrumentation-long-task/package.json b/plugins/web/opentelemetry-instrumentation-long-task/package.json index 1ec090c37c..3b1ff6e500 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/package.json +++ b/plugins/web/opentelemetry-instrumentation-long-task/package.json @@ -14,7 +14,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-user-interaction --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json index 46268e890c..f7236de922 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/package.json +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/package.json @@ -14,7 +14,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/instrumentation-user-interaction --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", diff --git a/plugins/web/opentelemetry-plugin-react-load/package.json b/plugins/web/opentelemetry-plugin-react-load/package.json index c1a8de2382..3994d17b54 100644 --- a/plugins/web/opentelemetry-plugin-react-load/package.json +++ b/plugins/web/opentelemetry-plugin-react-load/package.json @@ -14,7 +14,7 @@ "precompile": "tsc --version && lerna run version:update --scope @opentelemetry/plugin-react-load --include-dependencies", "prewatch": "npm run precompile", "version:update": "node ../../../scripts/version-update.js", - "compile": "npm run version:update && tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", + "compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json", "prepublishOnly": "npm run compile", "tdd": "karma start", "test:browser": "nyc karma start --single-run", From 8c578cd17b25b33390e4237596b9e5cbbc0d0b6d Mon Sep 17 00:00:00 2001 From: David Luna Date: Wed, 22 May 2024 21:55:22 +0200 Subject: [PATCH 3/6] feat(instr-tedious): add support for v16 and v17 (#2178) Closes: #1656 Co-authored-by: gurke Co-authored-by: Trent Mick --- package-lock.json | 888 +++++++++++------- .../src/test-utils.ts | 30 +- plugins/node/instrumentation-tedious/.tav.yml | 9 +- .../node/instrumentation-tedious/README.md | 2 +- .../node/instrumentation-tedious/package.json | 3 +- .../src/instrumentation.ts | 2 +- .../test/instrumentation.test.ts | 14 +- 7 files changed, 582 insertions(+), 366 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30b61cfd9a..96bfea2bfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3858,30 +3858,28 @@ } }, "node_modules/@azure/identity": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.1.0.tgz", - "integrity": "sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.4.2.tgz", + "integrity": "sha512-0q5DL4uyR0EZ4RXQKD8MadGH6zTIcloUoS/RVbCpNpej4pwte0xpqYxk8K97Py2RiuUvI7F4GXpoT4046VfufA==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.5.0", "@azure/core-client": "^1.4.0", "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.0.0", + "@azure/core-util": "^1.6.1", "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^2.26.0", - "@azure/msal-common": "^7.0.0", - "@azure/msal-node": "^1.10.0", + "@azure/msal-browser": "^3.5.0", + "@azure/msal-node": "^2.5.1", "events": "^3.0.0", "jws": "^4.0.0", "open": "^8.0.0", "stoppable": "^1.1.0", - "tslib": "^2.2.0", - "uuid": "^8.3.0" + "tslib": "^2.2.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" } }, "node_modules/@azure/identity/node_modules/events": { @@ -3928,58 +3926,38 @@ } }, "node_modules/@azure/msal-browser": { - "version": "2.38.3", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.3.tgz", - "integrity": "sha512-2WuLFnWWPR1IdvhhysT18cBbkXx1z0YIchVss5AwVA95g7CU5CpT3d+5BcgVGNXDXbUU7/5p0xYHV99V5z8C/A==", - "deprecated": "A newer major version of this library is available. Please upgrade to the latest available version.", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.13.0.tgz", + "integrity": "sha512-fD906nmJei3yE7la6DZTdUtXKvpwzJURkfsiz9747Icv4pit77cegSm6prJTKLQ1fw4iiZzrrWwxnhMLrTf5gQ==", "dev": true, "dependencies": { - "@azure/msal-common": "13.3.1" + "@azure/msal-common": "14.9.0" }, "engines": { "node": ">=0.8.0" } }, - "node_modules/@azure/msal-browser/node_modules/@azure/msal-common": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz", - "integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/@azure/msal-common": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.6.0.tgz", - "integrity": "sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q==", + "version": "14.9.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.9.0.tgz", + "integrity": "sha512-yzBPRlWPnTBeixxLNI3BBIgF5/bHpbhoRVuuDBnYjCyWRavaPUsKAHUDYLqpGkBLDciA6TCc6GOxN4/S3WiSxg==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-node": { - "version": "1.18.4", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", - "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", - "deprecated": "A newer major version of this library is available. Please upgrade to the latest available version.", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.7.0.tgz", + "integrity": "sha512-wXD8LkUvHICeSWZydqg6o8Yvv+grlBEcmLGu+QEI4FcwFendbTEZrlSygnAXXSOCVaGAirWLchca35qrgpO6Jw==", "dev": true, "dependencies": { - "@azure/msal-common": "13.3.1", + "@azure/msal-common": "14.9.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" }, "engines": { - "node": "10 || 12 || 14 || 16 || 18" - } - }, - "node_modules/@azure/msal-node/node_modules/@azure/msal-common": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz", - "integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==", - "dev": true, - "engines": { - "node": ">=0.8.0" + "node": ">=16" } }, "node_modules/@babel/code-frame": { @@ -11126,6 +11104,22 @@ "@types/react": "*" } }, + "node_modules/@types/readable-stream": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.12.tgz", + "integrity": "sha512-SCaw+bs9o/HCX1eTa3glTcQgW1oPxof49mqP2Qikik3xzTimNv2M4p43BQHhBuf7CwOJdQW0s1SrWU3MZxz6lw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/@types/redis": { "version": "2.8.32", "resolved": "https://registry.npmjs.org/@types/redis/-/redis-2.8.32.tgz", @@ -15405,6 +15399,57 @@ "node": ">= 14" } }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/dataloader": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.2.2.tgz", @@ -16282,18 +16327,22 @@ "dev": true }, "node_modules/es-abstract": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.4.tgz", - "integrity": "sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.6", + "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.2", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.4", @@ -16301,15 +16350,16 @@ "globalthis": "^1.0.3", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.1", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", @@ -16317,17 +16367,17 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.1", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" }, "engines": { "node": ">= 0.4" @@ -16337,19 +16387,19 @@ } }, "node_modules/es-aggregate-error": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.12.tgz", - "integrity": "sha512-j0PupcmELoVbYS2NNrsn5zcLLEsryQwP02x8fRawh7c2eEaPHwJFAxltZsqV7HJjsF57+SMpYyVRWgbVLfOagg==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.13.tgz", + "integrity": "sha512-KkzhUUuD2CUMqEc8JEqsXEMDHzDPE8RCjZeUBitsnB1eNcAJWQPiciKsMXe3Yytj4Flw1XLl46Qcf9OxvZha7A==", "dev": true, "dependencies": { - "define-data-property": "^1.1.1", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.1.0", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.1", - "set-function-name": "^2.0.1" + "has-property-descriptors": "^1.0.2", + "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" @@ -16391,6 +16441,18 @@ "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", "dev": true }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -19317,9 +19379,9 @@ } }, "node_modules/hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dependencies": { "function-bind": "^1.1.2" }, @@ -20182,6 +20244,21 @@ "node": ">= 0.4" } }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -30731,13 +30808,13 @@ "dev": true }, "node_modules/safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "dependencies": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -32465,14 +32542,15 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -32482,28 +32560,31 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -32860,96 +32941,6 @@ "node": ">=8.0.0" } }, - "node_modules/tedious": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-15.1.3.tgz", - "integrity": "sha512-166EpRm5qknwhEisjZqz/mF7k14fXKJYHRg6XiAXVovd/YkyHJ3SG4Ppy89caPaNFfRr7PVYe+s4dAvKaCMFvw==", - "dev": true, - "dependencies": { - "@azure/identity": "^2.0.4", - "@azure/keyvault-keys": "^4.4.0", - "@js-joda/core": "^5.2.0", - "bl": "^5.0.0", - "es-aggregate-error": "^1.0.8", - "iconv-lite": "^0.6.3", - "js-md4": "^0.3.2", - "jsbi": "^4.3.0", - "native-duplexpair": "^1.0.0", - "node-abort-controller": "^3.0.1", - "punycode": "^2.1.0", - "sprintf-js": "^1.1.2" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/tedious/node_modules/bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "node_modules/tedious/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/tedious/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/tedious/node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -34328,9 +34319,9 @@ } }, "node_modules/typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "dependencies": { "call-bind": "^1.0.7", @@ -35814,16 +35805,16 @@ "dev": true }, "node_modules/which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -37843,7 +37834,8 @@ "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "5.0.5", - "tedious": "15.1.3", + "semver": "7.6.0", + "tedious": "17.0.0", "test-all-versions": "6.1.0", "ts-mocha": "10.0.0", "typescript": "4.4.4" @@ -37855,6 +37847,121 @@ "@opentelemetry/api": "^1.3.0" } }, + "plugins/node/instrumentation-tedious/node_modules/bl": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.12.tgz", + "integrity": "sha512-EnEYHilP93oaOa2MnmNEjAcovPS3JlQZOyzGXi3EyEpPhm9qWvdDp7BmAVEVusGzp8LlwQK56Av+OkDoRjzE0w==", + "dev": true, + "dependencies": { + "@types/readable-stream": "^4.0.0", + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + } + }, + "plugins/node/instrumentation-tedious/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "plugins/node/instrumentation-tedious/node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "plugins/node/instrumentation-tedious/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "plugins/node/instrumentation-tedious/node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "plugins/node/instrumentation-tedious/node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "plugins/node/instrumentation-tedious/node_modules/tedious": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-17.0.0.tgz", + "integrity": "sha512-tXsl/kvDAFpnXU+ooEOQyrXdJFD0/OWvPq9i1bDhbOvoFGcrZURiXyUxbI8gJPsG6o2K5fs3HX6zRTSxuCUC5g==", + "dev": true, + "dependencies": { + "@azure/identity": "^3.4.1", + "@azure/keyvault-keys": "^4.4.0", + "@js-joda/core": "^5.5.3", + "bl": "^6.0.3", + "es-aggregate-error": "^1.0.9", + "iconv-lite": "^0.6.3", + "js-md4": "^0.3.2", + "jsbi": "^4.3.0", + "native-duplexpair": "^1.0.0", + "node-abort-controller": "^3.1.1", + "sprintf-js": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, "plugins/node/instrumentation-undici": { "name": "@opentelemetry/instrumentation-undici", "version": "0.2.0", @@ -42672,27 +42779,25 @@ } }, "@azure/identity": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-2.1.0.tgz", - "integrity": "sha512-BPDz1sK7Ul9t0l9YKLEa8PHqWU4iCfhGJ+ELJl6c8CP3TpJt2urNCbm0ZHsthmxRsYoMPbz2Dvzj30zXZVmAFw==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-3.4.2.tgz", + "integrity": "sha512-0q5DL4uyR0EZ4RXQKD8MadGH6zTIcloUoS/RVbCpNpej4pwte0xpqYxk8K97Py2RiuUvI7F4GXpoT4046VfufA==", "dev": true, "requires": { "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.5.0", "@azure/core-client": "^1.4.0", "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.0.0", + "@azure/core-util": "^1.6.1", "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^2.26.0", - "@azure/msal-common": "^7.0.0", - "@azure/msal-node": "^1.10.0", + "@azure/msal-browser": "^3.5.0", + "@azure/msal-node": "^2.5.1", "events": "^3.0.0", "jws": "^4.0.0", "open": "^8.0.0", "stoppable": "^1.1.0", - "tslib": "^2.2.0", - "uuid": "^8.3.0" + "tslib": "^2.2.0" }, "dependencies": { "events": { @@ -42732,45 +42837,29 @@ } }, "@azure/msal-browser": { - "version": "2.38.3", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-2.38.3.tgz", - "integrity": "sha512-2WuLFnWWPR1IdvhhysT18cBbkXx1z0YIchVss5AwVA95g7CU5CpT3d+5BcgVGNXDXbUU7/5p0xYHV99V5z8C/A==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.13.0.tgz", + "integrity": "sha512-fD906nmJei3yE7la6DZTdUtXKvpwzJURkfsiz9747Icv4pit77cegSm6prJTKLQ1fw4iiZzrrWwxnhMLrTf5gQ==", "dev": true, "requires": { - "@azure/msal-common": "13.3.1" - }, - "dependencies": { - "@azure/msal-common": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz", - "integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==", - "dev": true - } + "@azure/msal-common": "14.9.0" } }, "@azure/msal-common": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-7.6.0.tgz", - "integrity": "sha512-XqfbglUTVLdkHQ8F9UQJtKseRr3sSnr9ysboxtoswvaMVaEfvyLtMoHv9XdKUfOc0qKGzNgRFd9yRjIWVepl6Q==", + "version": "14.9.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.9.0.tgz", + "integrity": "sha512-yzBPRlWPnTBeixxLNI3BBIgF5/bHpbhoRVuuDBnYjCyWRavaPUsKAHUDYLqpGkBLDciA6TCc6GOxN4/S3WiSxg==", "dev": true }, "@azure/msal-node": { - "version": "1.18.4", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-1.18.4.tgz", - "integrity": "sha512-Kc/dRvhZ9Q4+1FSfsTFDME/v6+R2Y1fuMty/TfwqE5p9GTPw08BPbKgeWinE8JRHRp+LemjQbUZsn4Q4l6Lszg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.7.0.tgz", + "integrity": "sha512-wXD8LkUvHICeSWZydqg6o8Yvv+grlBEcmLGu+QEI4FcwFendbTEZrlSygnAXXSOCVaGAirWLchca35qrgpO6Jw==", "dev": true, "requires": { - "@azure/msal-common": "13.3.1", + "@azure/msal-common": "14.9.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" - }, - "dependencies": { - "@azure/msal-common": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz", - "integrity": "sha512-Lrk1ozoAtaP/cp53May3v6HtcFSVxdFrg2Pa/1xu5oIvsIwhxW6zSPibKefCOVgd5osgykMi5jjcZHv8XkzZEQ==", - "dev": true - } } }, "@babel/code-frame": { @@ -48329,10 +48418,88 @@ "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "5.0.5", - "tedious": "15.1.3", + "semver": "7.6.0", + "tedious": "17.0.0", "test-all-versions": "6.1.0", "ts-mocha": "10.0.0", "typescript": "4.4.4" + }, + "dependencies": { + "bl": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.12.tgz", + "integrity": "sha512-EnEYHilP93oaOa2MnmNEjAcovPS3JlQZOyzGXi3EyEpPhm9qWvdDp7BmAVEVusGzp8LlwQK56Av+OkDoRjzE0w==", + "dev": true, + "requires": { + "@types/readable-stream": "^4.0.0", + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "dev": true, + "requires": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + } + }, + "tedious": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/tedious/-/tedious-17.0.0.tgz", + "integrity": "sha512-tXsl/kvDAFpnXU+ooEOQyrXdJFD0/OWvPq9i1bDhbOvoFGcrZURiXyUxbI8gJPsG6o2K5fs3HX6zRTSxuCUC5g==", + "dev": true, + "requires": { + "@azure/identity": "^3.4.1", + "@azure/keyvault-keys": "^4.4.0", + "@js-joda/core": "^5.5.3", + "bl": "^6.0.3", + "es-aggregate-error": "^1.0.9", + "iconv-lite": "^0.6.3", + "js-md4": "^0.3.2", + "jsbi": "^4.3.0", + "native-duplexpair": "^1.0.0", + "node-abort-controller": "^3.1.1", + "sprintf-js": "^1.1.2" + } + } } }, "@opentelemetry/instrumentation-undici": { @@ -50653,6 +50820,24 @@ "@types/react": "*" } }, + "@types/readable-stream": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.12.tgz", + "integrity": "sha512-SCaw+bs9o/HCX1eTa3glTcQgW1oPxof49mqP2Qikik3xzTimNv2M4p43BQHhBuf7CwOJdQW0s1SrWU3MZxz6lw==", + "dev": true, + "requires": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, "@types/redis": { "version": "2.8.32", "resolved": "https://registry.npmjs.org/@types/redis/-/redis-2.8.32.tgz", @@ -54057,6 +54242,39 @@ "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", "dev": true }, + "data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "requires": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, "dataloader": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.2.2.tgz", @@ -54767,18 +54985,22 @@ "dev": true }, "es-abstract": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.4.tgz", - "integrity": "sha512-vZYJlk2u6qHYxBOTjAeg7qUxHdNfih64Uu2J8QqWgXZ2cri0ZpJAkzDUK/q593+mvKwlxyaxr6F1Q+3LKoQRgg==", + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, "requires": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.6", + "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.2", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", "es-to-primitive": "^1.2.1", "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.4", @@ -54786,15 +55008,16 @@ "globalthis": "^1.0.3", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.1", + "has-proto": "^1.0.3", "has-symbols": "^1.0.3", - "hasown": "^2.0.1", + "hasown": "^2.0.2", "internal-slot": "^1.0.7", "is-array-buffer": "^3.0.4", "is-callable": "^1.2.7", - "is-negative-zero": "^2.0.2", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", + "is-shared-array-buffer": "^1.0.3", "is-string": "^1.0.7", "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", @@ -54802,33 +55025,33 @@ "object-keys": "^1.1.1", "object.assign": "^4.1.5", "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.0", + "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.8", - "string.prototype.trimend": "^1.0.7", - "string.prototype.trimstart": "^1.0.7", - "typed-array-buffer": "^1.0.1", - "typed-array-byte-length": "^1.0.0", - "typed-array-byte-offset": "^1.0.0", - "typed-array-length": "^1.0.4", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.14" + "which-typed-array": "^1.1.15" } }, "es-aggregate-error": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.12.tgz", - "integrity": "sha512-j0PupcmELoVbYS2NNrsn5zcLLEsryQwP02x8fRawh7c2eEaPHwJFAxltZsqV7HJjsF57+SMpYyVRWgbVLfOagg==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/es-aggregate-error/-/es-aggregate-error-1.0.13.tgz", + "integrity": "sha512-KkzhUUuD2CUMqEc8JEqsXEMDHzDPE8RCjZeUBitsnB1eNcAJWQPiciKsMXe3Yytj4Flw1XLl46Qcf9OxvZha7A==", "dev": true, "requires": { - "define-data-property": "^1.1.1", + "define-data-property": "^1.1.4", "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.1.0", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", "function-bind": "^1.1.2", "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.1", - "set-function-name": "^2.0.1" + "has-property-descriptors": "^1.0.2", + "set-function-name": "^2.0.2" } }, "es-array-method-boxes-properly": { @@ -54858,6 +55081,15 @@ "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", "dev": true }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "es-set-tostringtag": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", @@ -57123,9 +57355,9 @@ } }, "hasown": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", - "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "requires": { "function-bind": "^1.1.2" } @@ -57804,6 +58036,15 @@ "hasown": "^2.0.0" } }, + "is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "requires": { + "is-typed-array": "^1.1.13" + } + }, "is-date-object": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", @@ -66128,13 +66369,13 @@ "dev": true }, "safe-array-concat": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.0.tgz", - "integrity": "sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, "requires": { - "call-bind": "^1.0.5", - "get-intrinsic": "^1.2.2", + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", "has-symbols": "^1.0.3", "isarray": "^2.0.5" }, @@ -67563,36 +67804,37 @@ } }, "string.prototype.trim": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", - "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimend": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", - "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "string.prototype.trimstart": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", - "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" } }, "strip-ansi": { @@ -67848,64 +68090,6 @@ "integrity": "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==", "dev": true }, - "tedious": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/tedious/-/tedious-15.1.3.tgz", - "integrity": "sha512-166EpRm5qknwhEisjZqz/mF7k14fXKJYHRg6XiAXVovd/YkyHJ3SG4Ppy89caPaNFfRr7PVYe+s4dAvKaCMFvw==", - "dev": true, - "requires": { - "@azure/identity": "^2.0.4", - "@azure/keyvault-keys": "^4.4.0", - "@js-joda/core": "^5.2.0", - "bl": "^5.0.0", - "es-aggregate-error": "^1.0.8", - "iconv-lite": "^0.6.3", - "js-md4": "^0.3.2", - "jsbi": "^4.3.0", - "native-duplexpair": "^1.0.0", - "node-abort-controller": "^3.0.1", - "punycode": "^2.1.0", - "sprintf-js": "^1.1.2" - }, - "dependencies": { - "bl": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-5.1.0.tgz", - "integrity": "sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==", - "dev": true, - "requires": { - "buffer": "^6.0.3", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - } - } - }, "temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -68963,9 +69147,9 @@ } }, "typed-array-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.5.tgz", - "integrity": "sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, "requires": { "call-bind": "^1.0.7", @@ -70147,16 +70331,16 @@ "dev": true }, "which-typed-array": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", - "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.6", - "call-bind": "^1.0.5", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.1" + "has-tostringtag": "^1.0.2" } }, "wide-align": { diff --git a/packages/opentelemetry-test-utils/src/test-utils.ts b/packages/opentelemetry-test-utils/src/test-utils.ts index aae38f160a..6edcddf4a3 100644 --- a/packages/opentelemetry-test-utils/src/test-utils.ts +++ b/packages/opentelemetry-test-utils/src/test-utils.ts @@ -18,7 +18,7 @@ import * as childProcess from 'child_process'; import { HrTime, Span, - SpanAttributes, + Attributes, SpanKind, SpanStatus, } from '@opentelemetry/api'; @@ -29,6 +29,7 @@ import { hrTimeToMicroseconds, } from '@opentelemetry/core'; import * as path from 'path'; +import * as fs from 'fs'; const dockerRunCmds = { cassandra: @@ -87,7 +88,7 @@ function run(cmd: string) { export const assertSpan = ( span: ReadableSpan, kind: SpanKind, - attributes: SpanAttributes, + attributes: Attributes, events: TimedEvent[], status: SpanStatus ) => { @@ -140,7 +141,7 @@ export interface TimedEvent { /** The name of the event. */ name: string; /** The attributes of the event. */ - attributes?: SpanAttributes; + attributes?: Attributes; /** Count of attributes of the event that were dropped due to collection limits */ droppedAttributesCount?: number; } @@ -153,11 +154,28 @@ export const getPackageVersion = (packageName: string) => { // "test-all-versions" tests that tend to install conflicting package // versions. Prefix the search paths with the cwd to include the workspace // dir. - const packagePath = require?.resolve(packageName, { + const mainPath = require?.resolve(packageName, { paths: [path.join(process.cwd(), 'node_modules')].concat( require?.main?.paths || [] ), }); - const packageJsonPath = path.join(path.dirname(packagePath), 'package.json'); - return require(packageJsonPath).version; + + // Some packages are resolved to a subfolder because their "main" points to it. + // As a consequence the "package.json" path is wrong and we get a MODULE_NOT_FOUND + // error. We should resolve the package folder from the closest `node_modules` ancestor. + // `tedious` package is an example + // { + // "name: "tedious", + // "main: "lib/tedious.js", + // ... + // } + // resolving `packagePath` to `/path/to/opentelemetry-js-contrib/node_modules/tedious/lib/tedious.js` + const idx = mainPath.lastIndexOf('node_modules'); + const pjPath = path.join( + mainPath.slice(0, idx), + 'node_modules', + packageName, + 'package.json' + ); + return JSON.parse(fs.readFileSync(pjPath, 'utf8')).version; }; diff --git a/plugins/node/instrumentation-tedious/.tav.yml b/plugins/node/instrumentation-tedious/.tav.yml index febeed20f0..0f4602307a 100644 --- a/plugins/node/instrumentation-tedious/.tav.yml +++ b/plugins/node/instrumentation-tedious/.tav.yml @@ -1,4 +1,7 @@ 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 || ^15.0.0" - commands: npm run test + versions: + include: ">=1.11.0 <=17" + # 4.0.0 is broken: https://github.com/tediousjs/tedious/commit/4eceb48 + exclude: "4.0.0" + mode: latest-majors + commands: npm run test \ No newline at end of file diff --git a/plugins/node/instrumentation-tedious/README.md b/plugins/node/instrumentation-tedious/README.md index 48863d1a3c..d12d5b1982 100644 --- a/plugins/node/instrumentation-tedious/README.md +++ b/plugins/node/instrumentation-tedious/README.md @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-tedious ## Supported Versions -- `>=1.11.0 <=15` +- `>=1.11.0 <=17` ## Usage diff --git a/plugins/node/instrumentation-tedious/package.json b/plugins/node/instrumentation-tedious/package.json index 82ca565cc3..959e8ab1e2 100644 --- a/plugins/node/instrumentation-tedious/package.json +++ b/plugins/node/instrumentation-tedious/package.json @@ -56,7 +56,8 @@ "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "5.0.5", - "tedious": "15.1.3", + "semver": "7.6.0", + "tedious": "17.0.0", "test-all-versions": "6.1.0", "ts-mocha": "10.0.0", "typescript": "4.4.4" diff --git a/plugins/node/instrumentation-tedious/src/instrumentation.ts b/plugins/node/instrumentation-tedious/src/instrumentation.ts index 78b11de517..b544ac9fe9 100644 --- a/plugins/node/instrumentation-tedious/src/instrumentation.ts +++ b/plugins/node/instrumentation-tedious/src/instrumentation.ts @@ -78,7 +78,7 @@ export class TediousInstrumentation extends InstrumentationBase { return [ new InstrumentationNodeModuleDefinition( TediousInstrumentation.COMPONENT, - ['>=1.11.0 <=15'], + ['>=1.11.0 <18'], (moduleExports: typeof tedious) => { const ConnectionPrototype: any = moduleExports.Connection.prototype; for (const method of PATCHED_METHODS) { diff --git a/plugins/node/instrumentation-tedious/test/instrumentation.test.ts b/plugins/node/instrumentation-tedious/test/instrumentation.test.ts index 5a531e2815..662a352559 100644 --- a/plugins/node/instrumentation-tedious/test/instrumentation.test.ts +++ b/plugins/node/instrumentation-tedious/test/instrumentation.test.ts @@ -38,6 +38,7 @@ import * as assert from 'assert'; import { TediousInstrumentation } from '../src'; import makeApi from './api'; import type { Connection, ConnectionConfig } from 'tedious'; +import * as semver from 'semver'; const port = Number(process.env.MSSQL_PORT) || 1433; const database = process.env.MSSQL_DATABASE || 'master'; @@ -71,6 +72,15 @@ const config: ConnectionConfig & { userName: string; password: string } = { }, }; +const processVersion = process.version; +const tediousVersion = testUtils.getPackageVersion('tedious'); +const incompatVersions = + // tedious@16 removed support for node v14 https://github.com/tediousjs/tedious/releases/tag/v16.0.0 + (semver.lt(processVersion, '15.0.0') && + semver.gte(tediousVersion, '16.0.0')) || + // tedious@17 removed support for node v16 and v19 https://github.com/tediousjs/tedious/releases/tag/v17.0.0 + (semver.lt(processVersion, '17.0.0') && semver.gte(tediousVersion, '17.0.0')); + describe('tedious', () => { let tedious: any; let contextManager: AsyncHooksContextManager; @@ -81,7 +91,7 @@ describe('tedious', () => { const memoryExporter = new InMemorySpanExporter(); before(function (done) { - if (!(shouldTest || shouldTestLocally)) { + if (!(shouldTest || shouldTestLocally) || incompatVersions) { // this.skip() workaround // https://github.com/mochajs/mocha/issues/2683#issuecomment-375629901 this.test!.parent!.pending = true; @@ -100,7 +110,7 @@ describe('tedious', () => { after(function () { if (shouldTestLocally) { - this.timeout(5000); + this.timeout(15000); testUtils.cleanUpDocker('mssql'); } }); From 816611e47e71ce1478f4749fe7b6ba923b8d473a Mon Sep 17 00:00:00 2001 From: Ievgen Makukh Date: Wed, 22 May 2024 23:32:59 +0300 Subject: [PATCH 4/6] perf(instrumentation-pg): do not split query to determine operation name (#2029) Co-authored-by: Amir Blum --- plugins/node/opentelemetry-instrumentation-pg/src/utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts index f0325bbd77..a16ccc9cd0 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/utils.ts @@ -86,7 +86,12 @@ export function getQuerySpanName( } function parseNormalizedOperationName(queryText: string) { - const sqlCommand = queryText.split(' ')[0].toUpperCase(); + const indexOfFirstSpace = queryText.indexOf(' '); + let sqlCommand = + indexOfFirstSpace === -1 + ? queryText + : queryText.slice(0, indexOfFirstSpace); + sqlCommand = sqlCommand.toUpperCase(); // Handle query text being "COMMIT;", which has an extra semicolon before the space. return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand; From 69cd638b986612b98310be822cd584ebcd93c647 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 22 May 2024 16:15:30 -0700 Subject: [PATCH 5/6] chore: update last deprecated usages of semantic-conventions pkg (#2210) Refs: #2025 --- .../opentelemetry-sampler-aws-xray/README.md | 31 +++++++------- .../auto-instrumentations-node/README.md | 4 +- .../src/resource-assertions.ts | 42 +++++++++---------- .../instrumentation-socket.io/test/utils.ts | 4 +- .../test/mongodb-v3.test.ts | 14 ++++--- .../test/mongodb-v4.test.ts | 6 +-- .../test/mongodb-v5-v6.test.ts | 6 +-- .../test/utils.ts | 21 ++++++---- 8 files changed, 66 insertions(+), 62 deletions(-) diff --git a/incubator/opentelemetry-sampler-aws-xray/README.md b/incubator/opentelemetry-sampler-aws-xray/README.md index 96852f6ab0..3656050787 100644 --- a/incubator/opentelemetry-sampler-aws-xray/README.md +++ b/incubator/opentelemetry-sampler-aws-xray/README.md @@ -19,10 +19,7 @@ const { AWSXRayPropagator } = require("@opentelemetry/propagator-aws-xray"); const { AWSXRayIdGenerator } = require("@opentelemetry/id-generator-aws-xray"); -// Initialize resource, trace exporter, span processor, and ID generator -const _resource = Resource.default().merge(new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: "remote-sampler-app", - })); +// Initialize trace exporter, span processor, and ID generator const _traceExporter = new OTLPTraceExporter(); const _spanProcessor = new BatchSpanProcessor(_traceExporter); const _tracerConfig = { @@ -32,19 +29,19 @@ const _tracerConfig = { } const sdk = new opentelemetry.NodeSDK({ - textMapPropagator: new AWSXRayPropagator(), - instrumentations: [ - new HttpInstrumentation(), - new AwsInstrumentation({ - suppressInternalInstrumentation: true - }), - ], - resource: _resource, - spanProcessor: _spanProcessor, - traceExporter: _traceExporter, - }); - - sdk.configureTracerProvider(_tracerConfig, _spanProcessor); + serviceName: "remote-sampler-app", + textMapPropagator: new AWSXRayPropagator(), + instrumentations: [ + new HttpInstrumentation(), + new AwsInstrumentation({ + suppressInternalInstrumentation: true + }), + ], + spanProcessor: _spanProcessor, + traceExporter: _traceExporter, +}); + +sdk.configureTracerProvider(_tracerConfig, _spanProcessor); ``` diff --git a/metapackages/auto-instrumentations-node/README.md b/metapackages/auto-instrumentations-node/README.md index 6d74119d8d..221a0570a5 100644 --- a/metapackages/auto-instrumentations-node/README.md +++ b/metapackages/auto-instrumentations-node/README.md @@ -119,14 +119,14 @@ const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node'); const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node'); const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector'); const { Resource } = require('@opentelemetry/resources'); -const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions'); +const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions'); const { SimpleSpanProcessor } = require('@opentelemetry/sdk-trace-base'); const { registerInstrumentations } = require('@opentelemetry/instrumentation'); const exporter = new CollectorTraceExporter(); const provider = new NodeTracerProvider({ resource: new Resource({ - [SemanticResourceAttributes.SERVICE_NAME]: 'basic-service', + [SEMRESATTRS_SERVICE_NAME]: 'basic-service', }), }); provider.addSpanProcessor(new SimpleSpanProcessor(exporter)); diff --git a/packages/opentelemetry-test-utils/src/resource-assertions.ts b/packages/opentelemetry-test-utils/src/resource-assertions.ts index eb248d41d8..51b1419187 100644 --- a/packages/opentelemetry-test-utils/src/resource-assertions.ts +++ b/packages/opentelemetry-test-utils/src/resource-assertions.ts @@ -18,7 +18,6 @@ import { SDK_INFO } from '@opentelemetry/core'; import * as assert from 'assert'; import { Resource } from '@opentelemetry/resources'; import { - SemanticResourceAttributes, SEMRESATTRS_CLOUD_ACCOUNT_ID, SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, SEMRESATTRS_CLOUD_PROVIDER, @@ -49,6 +48,7 @@ import { SEMRESATTRS_TELEMETRY_SDK_NAME, SEMRESATTRS_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions'; +import * as semconv from '@opentelemetry/semantic-conventions'; /** * Test utility method to validate a cloud resource @@ -65,7 +65,7 @@ export const assertCloudResource = ( zone?: string; } ) => { - assertHasOneLabel('CLOUD', resource); + assertHasOneLabel('cloud', resource); if (validations.provider) assert.strictEqual( resource.attributes[SEMRESATTRS_CLOUD_PROVIDER], @@ -103,7 +103,7 @@ export const assertContainerResource = ( imageTag?: string; } ) => { - assertHasOneLabel('CONTAINER', resource); + assertHasOneLabel('container', resource); if (validations.name) assert.strictEqual( resource.attributes[SEMRESATTRS_CONTAINER_NAME], @@ -143,7 +143,7 @@ export const assertHostResource = ( imageVersion?: string; } ) => { - assertHasOneLabel('HOST', resource); + assertHasOneLabel('host', resource); if (validations.id) assert.strictEqual( resource.attributes[SEMRESATTRS_HOST_ID], @@ -191,7 +191,7 @@ export const assertK8sResource = ( deploymentName?: string; } ) => { - assertHasOneLabel('K8S', resource); + assertHasOneLabel('k8s', resource); if (validations.clusterName) assert.strictEqual( resource.attributes[SEMRESATTRS_K8S_CLUSTER_NAME], @@ -335,26 +335,26 @@ export const assertEmptyResource = (resource: Resource) => { assert.strictEqual(Object.keys(resource.attributes).length, 0); }; +/** + * Assert that the `resource` has at least one known attribute with the given + * `prefix`. By "known", we mean it is an attribute defined in semconv. + */ const assertHasOneLabel = (prefix: string, resource: Resource): void => { - const hasOne = Object.entries(SemanticResourceAttributes).find( - ([key, value]) => { - return ( - key.startsWith(prefix) && - Object.prototype.hasOwnProperty.call(resource.attributes, value) - ); - } + const semconvModPrefix = `SEMRESATTRS_${prefix.toUpperCase()}_`; + const knownAttrs: Set = new Set( + Object.entries(semconv) + .filter( + ([k, v]) => typeof v === 'string' && k.startsWith(semconvModPrefix) + ) + .map(([, v]) => v as string) ); + const hasAttrs = Object.keys(resource.attributes).filter(k => + knownAttrs.has(k) + ); assert.ok( - hasOne, + hasAttrs.length > 0, 'Resource must have one of the following attributes: ' + - Object.entries(SemanticResourceAttributes) - .reduce((result, [key, value]) => { - if (key.startsWith(prefix)) { - result.push(value); - } - return result; - }) - .join(', ') + Array.from(knownAttrs).join(', ') ); }; diff --git a/plugins/node/instrumentation-socket.io/test/utils.ts b/plugins/node/instrumentation-socket.io/test/utils.ts index 86144d5f4d..1561a5ec4e 100644 --- a/plugins/node/instrumentation-socket.io/test/utils.ts +++ b/plugins/node/instrumentation-socket.io/test/utils.ts @@ -17,7 +17,7 @@ import { strict as assert } from 'assert'; import * as http from 'http'; import { AddressInfo } from 'net'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMATTRS_MESSAGING_SYSTEM } from '@opentelemetry/semantic-conventions'; import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import { getTestSpans } from '@opentelemetry/contrib-test-utils'; @@ -57,7 +57,7 @@ export const createServerInstance = (server?: http.Server) => { export const getSocketIoSpans = (): ReadableSpan[] => getTestSpans().filter( - s => s.attributes[SemanticAttributes.MESSAGING_SYSTEM] === 'socket.io' + s => s.attributes[SEMATTRS_MESSAGING_SYSTEM] === 'socket.io' ) as ReadableSpan[]; export const expectSpan = ( diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts index 144c375c68..dba836dc3a 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v3.test.ts @@ -33,7 +33,11 @@ const instrumentation = registerInstrumentationTesting( import type { MongoClient, Collection } from 'mongodb'; import { assertSpans, accessCollection, DEFAULT_MONGO_HOST } from './utils'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { + SEMATTRS_DB_STATEMENT, + SEMATTRS_NET_PEER_NAME, + SEMATTRS_NET_PEER_PORT, +} from '@opentelemetry/semantic-conventions'; describe('MongoDBInstrumentation-Tracing-v3', () => { function create(config: MongoDBInstrumentationConfig = {}) { @@ -295,7 +299,7 @@ describe('MongoDBInstrumentation-Tracing-v3', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], '?'); done(); @@ -341,7 +345,7 @@ describe('MongoDBInstrumentation-Tracing-v3', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], value); done(); @@ -580,11 +584,11 @@ describe('MongoDBInstrumentation-Tracing-v3', () => { (err, address) => { if (err) return done(err); assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.NET_PEER_NAME], + mongoSpan.attributes[SEMATTRS_NET_PEER_NAME], address ); assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.NET_PEER_PORT], + mongoSpan.attributes[SEMATTRS_NET_PEER_PORT], process.env.MONGODB_PORT ? parseInt(process.env.MONGODB_PORT) : 27017 diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts index 1a8af5f081..df2c48be5f 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v4.test.ts @@ -35,7 +35,7 @@ const instrumentation = registerInstrumentationTesting( import type { MongoClient, Collection } from 'mongodb'; import { assertSpans, accessCollection, DEFAULT_MONGO_HOST } from './utils'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMATTRS_DB_STATEMENT } from '@opentelemetry/semantic-conventions'; describe('MongoDBInstrumentation-Tracing-v4', () => { function create(config: MongoDBInstrumentationConfig = {}) { @@ -334,7 +334,7 @@ describe('MongoDBInstrumentation-Tracing-v4', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], '?'); done(); @@ -380,7 +380,7 @@ describe('MongoDBInstrumentation-Tracing-v4', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], value); done(); diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v5-v6.test.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v5-v6.test.ts index be6ac80ee0..546aba2e31 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v5-v6.test.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/mongodb-v5-v6.test.ts @@ -44,7 +44,7 @@ let instrumentation: MongoDBInstrumentation; import type { MongoClient, Collection } from 'mongodb'; import { assertSpans, accessCollection, DEFAULT_MONGO_HOST } from './utils'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { SEMATTRS_DB_STATEMENT } from '@opentelemetry/semantic-conventions'; describe('MongoDBInstrumentation-Tracing-v5', () => { function create(config: MongoDBInstrumentationConfig = {}) { @@ -337,7 +337,7 @@ describe('MongoDBInstrumentation-Tracing-v5', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], '?'); done(); @@ -383,7 +383,7 @@ describe('MongoDBInstrumentation-Tracing-v5', () => { ); const mongoSpan = spans.find(s => s.name === operationName); const dbStatement = JSON.parse( - mongoSpan!.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan!.attributes[SEMATTRS_DB_STATEMENT] as string ); assert.strictEqual(dbStatement[key], value); done(); diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts b/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts index a158cc9b16..07ce789975 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/test/utils.ts @@ -15,7 +15,13 @@ */ import { SpanKind, SpanStatusCode } from '@opentelemetry/api'; -import { SemanticAttributes } from '@opentelemetry/semantic-conventions'; +import { + SEMATTRS_DB_CONNECTION_STRING, + SEMATTRS_DB_OPERATION, + SEMATTRS_DB_STATEMENT, + SEMATTRS_DB_SYSTEM, + SEMATTRS_NET_PEER_NAME, +} from '@opentelemetry/semantic-conventions'; import { ReadableSpan } from '@opentelemetry/sdk-trace-base'; import * as assert from 'assert'; import type { MongoClient, MongoClientOptions, Collection } from 'mongodb'; @@ -93,28 +99,25 @@ export function assertSpans( assert.strictEqual(mongoSpan.name, expectedName); assert.strictEqual(mongoSpan.kind, expectedKind); assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.DB_OPERATION], + mongoSpan.attributes[SEMATTRS_DB_OPERATION], expectedOperation ); + assert.strictEqual(mongoSpan.attributes[SEMATTRS_DB_SYSTEM], 'mongodb'); assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.DB_SYSTEM], - 'mongodb' - ); - assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.NET_PEER_NAME], + mongoSpan.attributes[SEMATTRS_NET_PEER_NAME], process.env.MONGODB_HOST || DEFAULT_MONGO_HOST ); assert.strictEqual(mongoSpan.status.code, SpanStatusCode.UNSET); if (expectedConnString) { assert.strictEqual( - mongoSpan.attributes[SemanticAttributes.DB_CONNECTION_STRING], + mongoSpan.attributes[SEMATTRS_DB_CONNECTION_STRING], expectedConnString ); } if (isEnhancedDatabaseReportingEnabled) { const dbStatement = JSON.parse( - mongoSpan.attributes[SemanticAttributes.DB_STATEMENT] as string + mongoSpan.attributes[SEMATTRS_DB_STATEMENT] as string ); for (const key in dbStatement) { assert.notStrictEqual(dbStatement[key], '?'); From 0cef9fa95d065489b7349bfa0150ff858ed59157 Mon Sep 17 00:00:00 2001 From: Amir Blum Date: Thu, 23 May 2024 10:23:25 +0300 Subject: [PATCH 6/6] refactor: use package json auto generated export also for npm package name (#2203) * refactor: rename VERSION to NPM_PACKAGE_VERSION * refactor: use auto-generated NPM_PACKAGE_NAME * fix: remove the NPM_ prefix from the auto generated names * fix: use PACKAGE_NAME in host-metrics * chore: apply also for new instrumentation kafkajs --- packages/opentelemetry-host-metrics/src/BaseMetrics.ts | 6 +++--- .../winston-transport/src/OpenTelemetryTransportV3.ts | 4 ++-- plugins/node/instrumentation-amqplib/src/amqplib.ts | 6 +++--- .../node/instrumentation-cucumber/src/instrumentation.ts | 4 ++-- .../instrumentation-dataloader/src/instrumentation.ts | 4 ++-- plugins/node/instrumentation-fs/src/instrumentation.ts | 4 ++-- .../node/instrumentation-kafkajs/src/instrumentation.ts | 4 ++-- .../instrumentation-lru-memoizer/src/instrumentation.ts | 4 ++-- plugins/node/instrumentation-mongoose/src/mongoose.ts | 4 ++-- .../instrumentation-runtime-node/src/instrumentation.ts | 6 +++--- plugins/node/instrumentation-socket.io/src/socket.io.ts | 8 ++------ .../node/instrumentation-tedious/src/instrumentation.ts | 4 ++-- plugins/node/instrumentation-undici/src/undici.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts | 4 ++-- .../src/OpenTelemetryBunyanStream.ts | 7 +++---- .../src/instrumentation.ts | 6 +++--- .../test/bunyan.test.ts | 6 +++--- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 6 +++--- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 6 +++--- .../src/instrumentation.ts | 6 +++--- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 6 +++--- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 8 ++------ .../src/instrumentation.ts | 8 ++------ .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 4 ++-- .../src/instrumentation.ts | 6 +++--- .../src/instrumentation.ts | 6 +++--- .../src/BaseOpenTelemetryComponent.ts | 8 ++++---- scripts/version-update.js | 3 ++- 47 files changed, 108 insertions(+), 120 deletions(-) diff --git a/packages/opentelemetry-host-metrics/src/BaseMetrics.ts b/packages/opentelemetry-host-metrics/src/BaseMetrics.ts index fa9453ff22..f314f79282 100644 --- a/packages/opentelemetry-host-metrics/src/BaseMetrics.ts +++ b/packages/opentelemetry-host-metrics/src/BaseMetrics.ts @@ -17,7 +17,7 @@ import * as api from '@opentelemetry/api'; import * as metrics from '@opentelemetry/sdk-metrics'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; /** * Metrics Collector Configuration @@ -33,7 +33,7 @@ export interface MetricsCollectorConfig { url?: string; } -const DEFAULT_NAME = '@opentelemetry/host-metrics'; +const DEFAULT_NAME = PACKAGE_NAME; /** * Base Class for metrics @@ -50,7 +50,7 @@ export abstract class BaseMetrics { if (!config.meterProvider) { this._logger.warn('No meter provider, using default'); } - this._meter = meterProvider.getMeter(this._name, VERSION); + this._meter = meterProvider.getMeter(this._name, PACKAGE_VERSION); } /** diff --git a/packages/winston-transport/src/OpenTelemetryTransportV3.ts b/packages/winston-transport/src/OpenTelemetryTransportV3.ts index a7e164adce..e3a93b1b57 100644 --- a/packages/winston-transport/src/OpenTelemetryTransportV3.ts +++ b/packages/winston-transport/src/OpenTelemetryTransportV3.ts @@ -16,7 +16,7 @@ import { Logger, logs } from '@opentelemetry/api-logs'; import TransportStream = require('winston-transport'); -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { emitLogRecord } from './utils'; export class OpenTelemetryTransportV3 extends TransportStream { @@ -24,7 +24,7 @@ export class OpenTelemetryTransportV3 extends TransportStream { constructor(options?: TransportStream.TransportStreamOptions) { super(options); - this._logger = logs.getLogger('@opentelemetry/winston-transport', VERSION); + this._logger = logs.getLogger(PACKAGE_NAME, PACKAGE_VERSION); } public override log(info: any, callback: () => void) { diff --git a/plugins/node/instrumentation-amqplib/src/amqplib.ts b/plugins/node/instrumentation-amqplib/src/amqplib.ts index c81e2b51a3..6cca9bfd80 100644 --- a/plugins/node/instrumentation-amqplib/src/amqplib.ts +++ b/plugins/node/instrumentation-amqplib/src/amqplib.ts @@ -72,15 +72,15 @@ import { normalizeExchange, unmarkConfirmChannelTracing, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; export class AmqplibInstrumentation extends InstrumentationBase { protected override _config!: AmqplibInstrumentationConfig; constructor(config: AmqplibInstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-amqplib', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/instrumentation-cucumber/src/instrumentation.ts b/plugins/node/instrumentation-cucumber/src/instrumentation.ts index 255b2a297c..42962feb78 100644 --- a/plugins/node/instrumentation-cucumber/src/instrumentation.ts +++ b/plugins/node/instrumentation-cucumber/src/instrumentation.ts @@ -38,7 +38,7 @@ import type { } from '@cucumber/cucumber/lib/support_code_library_builder/types'; import { AttributeNames, CucumberInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const hooks = ['Before', 'BeforeStep', 'AfterStep', 'After'] as const; const steps = ['Given', 'When', 'Then'] as const; @@ -50,7 +50,7 @@ export class CucumberInstrumentation extends InstrumentationBase { private module: Cucumber | undefined; constructor(config: CucumberInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-cucumber', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init(): InstrumentationNodeModuleDefinition[] { diff --git a/plugins/node/instrumentation-dataloader/src/instrumentation.ts b/plugins/node/instrumentation-dataloader/src/instrumentation.ts index adabc3c36d..ecfa6ac9aa 100644 --- a/plugins/node/instrumentation-dataloader/src/instrumentation.ts +++ b/plugins/node/instrumentation-dataloader/src/instrumentation.ts @@ -27,7 +27,7 @@ import { SpanKind, } from '@opentelemetry/api'; import { DataloaderInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import type * as Dataloader from 'dataloader'; const MODULE_NAME = 'dataloader'; @@ -45,7 +45,7 @@ type LoadManyFn = (typeof Dataloader.prototype)['loadMany']; export class DataloaderInstrumentation extends InstrumentationBase { constructor(config: DataloaderInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-dataloader', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/instrumentation-fs/src/instrumentation.ts b/plugins/node/instrumentation-fs/src/instrumentation.ts index 08490f496b..57db632a0e 100644 --- a/plugins/node/instrumentation-fs/src/instrumentation.ts +++ b/plugins/node/instrumentation-fs/src/instrumentation.ts @@ -21,7 +21,7 @@ import { InstrumentationNodeModuleDefinition, isWrapped, } from '@opentelemetry/instrumentation'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { CALLBACK_FUNCTIONS, PROMISE_FUNCTIONS, @@ -53,7 +53,7 @@ function patchedFunctionWithOriginalProperties< export default class FsInstrumentation extends InstrumentationBase { constructor(config: FsInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-fs', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init(): ( diff --git a/plugins/node/instrumentation-kafkajs/src/instrumentation.ts b/plugins/node/instrumentation-kafkajs/src/instrumentation.ts index 09762e8e6f..ed3eeeea27 100644 --- a/plugins/node/instrumentation-kafkajs/src/instrumentation.ts +++ b/plugins/node/instrumentation-kafkajs/src/instrumentation.ts @@ -44,7 +44,7 @@ import type { Consumer, } from 'kafkajs'; import { KafkaJsInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { bufferTextMapGetter } from './propagator'; import { InstrumentationBase, @@ -57,7 +57,7 @@ export class KafkaJsInstrumentation extends InstrumentationBase { protected override _config!: KafkaJsInstrumentationConfig; constructor(config: KafkaJsInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-kafkajs', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts b/plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts index 09112043d2..6224fe7edf 100644 --- a/plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts +++ b/plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts @@ -20,11 +20,11 @@ import { InstrumentationConfig, InstrumentationNodeModuleDefinition, } from '@opentelemetry/instrumentation'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; export default class LruMemoizerInstrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-lru-memoizer', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init(): InstrumentationNodeModuleDefinition[] { diff --git a/plugins/node/instrumentation-mongoose/src/mongoose.ts b/plugins/node/instrumentation-mongoose/src/mongoose.ts index ff76b33735..0cd136f4fa 100644 --- a/plugins/node/instrumentation-mongoose/src/mongoose.ts +++ b/plugins/node/instrumentation-mongoose/src/mongoose.ts @@ -27,7 +27,7 @@ import { InstrumentationModuleDefinition, InstrumentationNodeModuleDefinition, } from '@opentelemetry/instrumentation'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { SEMATTRS_DB_OPERATION, SEMATTRS_DB_STATEMENT, @@ -61,7 +61,7 @@ export class MongooseInstrumentation extends InstrumentationBase { protected override _config!: MongooseInstrumentationConfig; constructor(config: MongooseInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-mongoose', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: MongooseInstrumentationConfig = {}) { diff --git a/plugins/node/instrumentation-runtime-node/src/instrumentation.ts b/plugins/node/instrumentation-runtime-node/src/instrumentation.ts index c7733e2de4..ba26129590 100644 --- a/plugins/node/instrumentation-runtime-node/src/instrumentation.ts +++ b/plugins/node/instrumentation-runtime-node/src/instrumentation.ts @@ -18,7 +18,7 @@ const { eventLoopUtilization } = performance; import { InstrumentationBase } from '@opentelemetry/instrumentation'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { RuntimeNodeInstrumentationConfig } from './types'; const ELUS_LENGTH = 2; @@ -32,8 +32,8 @@ export class RuntimeNodeInstrumentation extends InstrumentationBase { constructor(config: RuntimeNodeInstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-runtime-node', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/instrumentation-socket.io/src/socket.io.ts b/plugins/node/instrumentation-socket.io/src/socket.io.ts index 5ed289c65b..9f8de7b534 100644 --- a/plugins/node/instrumentation-socket.io/src/socket.io.ts +++ b/plugins/node/instrumentation-socket.io/src/socket.io.ts @@ -37,7 +37,7 @@ import { } from '@opentelemetry/semantic-conventions'; import { SocketIoInstrumentationConfig } from './types'; import { SocketIoInstrumentationAttributes } from './AttributeNames'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { extractRoomsAttributeValue, isPromise, @@ -57,11 +57,7 @@ export class SocketIoInstrumentation extends InstrumentationBase { protected override _config!: SocketIoInstrumentationConfig; constructor(config: SocketIoInstrumentationConfig = {}) { - super( - '@opentelemetry/instrumentation-socket.io', - VERSION, - normalizeConfig(config) - ); + super(PACKAGE_NAME, PACKAGE_VERSION, normalizeConfig(config)); } protected init() { diff --git a/plugins/node/instrumentation-tedious/src/instrumentation.ts b/plugins/node/instrumentation-tedious/src/instrumentation.ts index b544ac9fe9..f701451421 100644 --- a/plugins/node/instrumentation-tedious/src/instrumentation.ts +++ b/plugins/node/instrumentation-tedious/src/instrumentation.ts @@ -34,7 +34,7 @@ import { import type * as tedious from 'tedious'; import { TediousInstrumentationConfig } from './types'; import { getSpanName, once } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const CURRENT_DATABASE = Symbol( 'opentelemetry.instrumentation-tedious.current-database' @@ -71,7 +71,7 @@ export class TediousInstrumentation extends InstrumentationBase { static readonly COMPONENT = 'tedious'; constructor(config: TediousInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-tedious', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/instrumentation-undici/src/undici.ts b/plugins/node/instrumentation-undici/src/undici.ts index ececad63c7..aa89c4f4ea 100644 --- a/plugins/node/instrumentation-undici/src/undici.ts +++ b/plugins/node/instrumentation-undici/src/undici.ts @@ -34,7 +34,7 @@ import { ValueType, } from '@opentelemetry/api'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { ListenerRecord, @@ -67,7 +67,7 @@ export class UndiciInstrumentation extends InstrumentationBase { private _httpClientDurationHistogram!: Histogram; constructor(config: UndiciInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-undici', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); this.setConfig(config); } diff --git a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts index 6d475f91dc..0d8eb8a5e2 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-lambda/src/instrumentation.ts @@ -57,7 +57,7 @@ import { } from 'aws-lambda'; import { AwsLambdaInstrumentationConfig, EventContextExtractor } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { env } from 'process'; import { LambdaModule } from './internal-types'; @@ -80,7 +80,7 @@ export class AwsLambdaInstrumentation extends InstrumentationBase { protected override _config!: AwsLambdaInstrumentationConfig; constructor(config: AwsLambdaInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-aws-lambda', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); if (this._config.disableAwsContextPropagation == null) { if ( typeof env['OTEL_LAMBDA_DISABLE_AWS_CONTEXT_PROPAGATION'] === diff --git a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts index d20d480180..cca362e293 100644 --- a/plugins/node/opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts +++ b/plugins/node/opentelemetry-instrumentation-aws-sdk/src/aws-sdk.ts @@ -33,7 +33,7 @@ import { NormalizedRequest, NormalizedResponse, } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { InstrumentationBase, InstrumentationModuleDefinition, @@ -78,7 +78,7 @@ export class AwsInstrumentation extends InstrumentationBase { private servicesExtensions: ServicesExtensions = new ServicesExtensions(); constructor(config: AwsSdkInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-aws-sdk', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: AwsSdkInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/src/OpenTelemetryBunyanStream.ts b/plugins/node/opentelemetry-instrumentation-bunyan/src/OpenTelemetryBunyanStream.ts index 8b3d1c8977..c82f967372 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/src/OpenTelemetryBunyanStream.ts +++ b/plugins/node/opentelemetry-instrumentation-bunyan/src/OpenTelemetryBunyanStream.ts @@ -16,11 +16,10 @@ import { logs, SeverityNumber, Logger } from '@opentelemetry/api-logs'; import type { LogLevelString } from 'bunyan'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; -const DEFAULT_INSTRUMENTATION_SCOPE_NAME = - '@opentelemetry/instrumentation-bunyan'; -const DEFAULT_INSTRUMENTATION_SCOPE_VERSION = VERSION; +const DEFAULT_INSTRUMENTATION_SCOPE_NAME = PACKAGE_NAME; +const DEFAULT_INSTRUMENTATION_SCOPE_VERSION = PACKAGE_VERSION; // This block is a copy (modulo code style and TypeScript types) of the Bunyan // code that defines log level value and names. These values won't ever change diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-bunyan/src/instrumentation.ts index 0f218787ea..c2eb53bb58 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-bunyan/src/instrumentation.ts @@ -22,7 +22,7 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { BunyanInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { OpenTelemetryBunyanStream } from './OpenTelemetryBunyanStream'; import type * as BunyanLogger from 'bunyan'; import { SeverityNumber } from '@opentelemetry/api-logs'; @@ -35,8 +35,8 @@ const DEFAULT_CONFIG: BunyanInstrumentationConfig = { export class BunyanInstrumentation extends InstrumentationBase { constructor(config: BunyanInstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-bunyan', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/opentelemetry-instrumentation-bunyan/test/bunyan.test.ts b/plugins/node/opentelemetry-instrumentation-bunyan/test/bunyan.test.ts index deaf2fb1e7..b26c290b97 100644 --- a/plugins/node/opentelemetry-instrumentation-bunyan/test/bunyan.test.ts +++ b/plugins/node/opentelemetry-instrumentation-bunyan/test/bunyan.test.ts @@ -33,7 +33,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { Writable } from 'stream'; import { BunyanInstrumentation, OpenTelemetryBunyanStream } from '../src'; -import { VERSION } from '../src/version'; +import { PACKAGE_VERSION } from '../src/version'; import type * as BunyanLogger from 'bunyan'; @@ -219,7 +219,7 @@ describe('BunyanInstrumentation', () => { rec.instrumentationScope.name, '@opentelemetry/instrumentation-bunyan' ); - assert.strictEqual(rec.instrumentationScope.version, VERSION); + assert.strictEqual(rec.instrumentationScope.version, PACKAGE_VERSION); assert.strictEqual(rec.spanContext, undefined); // spanContext @@ -519,7 +519,7 @@ describe('OpenTelemetryBunyanStream', () => { rec.instrumentationScope.name, '@opentelemetry/instrumentation-bunyan' ); - assert.strictEqual(rec.instrumentationScope.version, VERSION); + assert.strictEqual(rec.instrumentationScope.version, PACKAGE_VERSION); assert.strictEqual(rec.spanContext, undefined); // spanContext diff --git a/plugins/node/opentelemetry-instrumentation-cassandra/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-cassandra/src/instrumentation.ts index f11ffab83e..3d90300b9c 100644 --- a/plugins/node/opentelemetry-instrumentation-cassandra/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-cassandra/src/instrumentation.ts @@ -39,7 +39,7 @@ import { SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_PEER_PORT, } from '@opentelemetry/semantic-conventions'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { EventEmitter } from 'events'; import type * as CassandraDriver from 'cassandra-driver'; @@ -49,7 +49,7 @@ export class CassandraDriverInstrumentation extends InstrumentationBase { protected override _config!: CassandraDriverInstrumentationConfig; constructor(config: CassandraDriverInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-cassandra-driver', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/opentelemetry-instrumentation-connect/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-connect/src/instrumentation.ts index 5b57f5f7bb..0c1fde4956 100644 --- a/plugins/node/opentelemetry-instrumentation-connect/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-connect/src/instrumentation.ts @@ -24,7 +24,7 @@ import { ConnectTypes, } from './enums/AttributeNames'; import { PatchedRequest, Use, UseArgs, UseArgs2 } from './internal-types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { InstrumentationBase, InstrumentationConfig, @@ -43,7 +43,7 @@ export const ANONYMOUS_NAME = 'anonymous'; /** Connect instrumentation for OpenTelemetry */ export class ConnectInstrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-connect', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init() { diff --git a/plugins/node/opentelemetry-instrumentation-dns/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-dns/src/instrumentation.ts index 0be1211a60..ae97438ddb 100644 --- a/plugins/node/opentelemetry-instrumentation-dns/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-dns/src/instrumentation.ts @@ -27,7 +27,7 @@ import { import { AddressFamily } from './enums/AddressFamily'; import { DnsInstrumentationConfig } from './types'; import * as utils from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { LookupCallbackSignature, LookupPromiseSignature, @@ -40,7 +40,7 @@ export class DnsInstrumentation extends InstrumentationBase { protected override _config!: DnsInstrumentationConfig; constructor(config: DnsInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-dns', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init(): ( diff --git a/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts index 76da7ffe5f..8337a17427 100644 --- a/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-express/src/instrumentation.ts @@ -33,7 +33,7 @@ import { isLayerIgnored, storeLayerPath, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { InstrumentationBase, InstrumentationNodeModuleDefinition, @@ -52,7 +52,7 @@ import { /** Express instrumentation for OpenTelemetry */ export class ExpressInstrumentation extends InstrumentationBase { constructor(config: ExpressInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-express', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: ExpressInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts index 208a2e09a5..34871ee978 100644 --- a/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts @@ -41,14 +41,14 @@ import { safeExecuteInTheMiddleMaybePromise, startSpan, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; export const ANONYMOUS_NAME = 'anonymous'; /** Fastify instrumentation for OpenTelemetry */ export class FastifyInstrumentation extends InstrumentationBase { constructor(config: FastifyInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-fastify', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: FastifyInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-generic-pool/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-generic-pool/src/instrumentation.ts index adefe5a7be..08b31e5eb1 100644 --- a/plugins/node/opentelemetry-instrumentation-generic-pool/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-generic-pool/src/instrumentation.ts @@ -24,7 +24,7 @@ import { import type * as genericPool from 'generic-pool'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const MODULE_NAME = 'generic-pool'; @@ -33,7 +33,7 @@ export default class Instrumentation extends InstrumentationBase { private _isDisabled = false; constructor(config: InstrumentationConfig = {}) { - super(`@opentelemetry/instrumentation-${MODULE_NAME}`, VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init() { diff --git a/plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts index 32fc2f4507..e6e55cf118 100644 --- a/plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-graphql/src/instrumentation.ts @@ -49,7 +49,7 @@ import { wrapFields, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import * as api from '@opentelemetry/api'; import type { PromiseOrValue } from 'graphql/jsutils/PromiseOrValue'; import { GraphQLInstrumentationConfig } from './types'; @@ -66,8 +66,8 @@ const supportedVersions = ['>=14 <17']; export class GraphQLInstrumentation extends InstrumentationBase { constructor(config: GraphQLInstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-graphql', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts index 0b18fc5dfd..8fd9442974 100644 --- a/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-hapi/src/instrumentation.ts @@ -24,7 +24,7 @@ import { } from '@opentelemetry/instrumentation'; import type * as Hapi from '@hapi/hapi'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { HapiComponentName, HapiServerRouteInput, @@ -50,7 +50,7 @@ import { /** Hapi instrumentation for OpenTelemetry */ export class HapiInstrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-hapi', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts index 34930c354b..abf9e2c5e8 100644 --- a/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-ioredis/src/instrumentation.ts @@ -33,7 +33,7 @@ import { import { safeExecuteInTheMiddle } from '@opentelemetry/instrumentation'; import { endSpan } from './utils'; import { defaultDbStatementSerializer } from '@opentelemetry/redis-common'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const DEFAULT_CONFIG: IORedisInstrumentationConfig = { requireParentSpan: true, @@ -44,8 +44,8 @@ export class IORedisInstrumentation extends InstrumentationBase { constructor(config: IORedisInstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-ioredis', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts index 762b9d1455..c80ebbe55c 100644 --- a/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts @@ -15,7 +15,7 @@ */ import * as api from '@opentelemetry/api'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import * as constants from './constants'; import { InstrumentationBase, @@ -45,8 +45,8 @@ const DEFAULT_CONFIG: types.KnexInstrumentationConfig = { export class KnexInstrumentation extends InstrumentationBase { constructor(config: types.KnexInstrumentationConfig = {}) { super( - `@opentelemetry/instrumentation-${constants.MODULE_NAME}`, - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts index ab6c2927be..0598850569 100644 --- a/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-koa/src/instrumentation.ts @@ -24,7 +24,7 @@ import { import type * as koa from 'koa'; import { KoaContext, KoaLayerType, KoaInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { getMiddlewareMetadata, isLayerIgnored } from './utils'; import { getRPCMetadata, RPCType } from '@opentelemetry/core'; import { @@ -36,7 +36,7 @@ import { /** Koa instrumentation for OpenTelemetry */ export class KoaInstrumentation extends InstrumentationBase { constructor(config: KoaInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-koa', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: KoaInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-memcached/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-memcached/src/instrumentation.ts index b72ab76896..600179254b 100644 --- a/plugins/node/opentelemetry-instrumentation-memcached/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-memcached/src/instrumentation.ts @@ -29,7 +29,7 @@ import { } from '@opentelemetry/semantic-conventions'; import * as utils from './utils'; import { InstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; export class Instrumentation extends InstrumentationBase { static readonly COMPONENT = 'memcached'; @@ -42,8 +42,8 @@ export class Instrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { super( - '@opentelemetry/instrumentation-memcached', - VERSION, + PACKAGE_NAME, + PACKAGE_VERSION, Object.assign({}, Instrumentation.DEFAULT_CONFIG, config) ); } diff --git a/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts index 7f9fa8e9c3..a1417a9487 100644 --- a/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts @@ -50,7 +50,7 @@ import { V4ConnectionPool, } from './internal-types'; import { V4Connect, V4Session } from './internal-types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { UpDownCounter } from '@opentelemetry/api'; /** mongodb instrumentation plugin for OpenTelemetry */ @@ -61,7 +61,7 @@ export class MongoDBInstrumentation extends InstrumentationBase { protected override _config!: MongoDBInstrumentationConfig; constructor(config: MongoDBInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-mongodb', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override _updateMetricInstruments() { diff --git a/plugins/node/opentelemetry-instrumentation-mysql/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-mysql/src/instrumentation.ts index cf43c406e6..11eab4bf93 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql/src/instrumentation.ts @@ -42,7 +42,7 @@ import { getSpanName, getPoolName, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { UpDownCounter, MeterProvider } from '@opentelemetry/api'; type getConnectionCallbackType = ( @@ -57,7 +57,7 @@ export class MySQLInstrumentation extends InstrumentationBase { private _connectionsUsage!: UpDownCounter; constructor(config: MySQLInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-mysql', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); this._setMetricInstruments(); } diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts index ade7fd117f..38f2ce8bd3 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts @@ -35,7 +35,7 @@ import { getSpanName, once, } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; type formatType = typeof mysqlTypes.format; @@ -45,7 +45,7 @@ export class MySQL2Instrumentation extends InstrumentationBase { }; constructor(config: MySQL2InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-mysql2', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/opentelemetry-instrumentation-nestjs-core/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-nestjs-core/src/instrumentation.ts index 9f90a7c1b8..a7b2380250 100644 --- a/plugins/node/opentelemetry-instrumentation-nestjs-core/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-nestjs-core/src/instrumentation.ts @@ -25,12 +25,12 @@ import { import type { NestFactory } from '@nestjs/core/nest-factory.js'; import type { RouterExecutionContext } from '@nestjs/core/router/router-execution-context.js'; import type { Controller } from '@nestjs/common/interfaces'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_URL, } from '@opentelemetry/semantic-conventions'; -import { VERSION } from './version'; import { AttributeNames, NestType } from './enums'; export class Instrumentation extends InstrumentationBase { @@ -40,7 +40,7 @@ export class Instrumentation extends InstrumentationBase { }; constructor(config: InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-nestjs-core', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init() { diff --git a/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts index 1cac375019..567df7dee3 100644 --- a/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-net/src/instrumentation.ts @@ -34,14 +34,14 @@ import { import { TLSAttributes } from './types'; import { NormalizedOptions, SocketEvent } from './internal-types'; import { getNormalizedArgs, IPC_TRANSPORT } from './utils'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { Socket } from 'net'; import { TLSSocket } from 'tls'; import type * as net from 'net'; export class NetInstrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-net', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init(): InstrumentationNodeModuleDefinition[] { diff --git a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts index 38ccad0fe4..c6bee00999 100644 --- a/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pg/src/instrumentation.ts @@ -39,12 +39,12 @@ import { import { PgInstrumentationConfig } from './types'; import * as utils from './utils'; import { addSqlCommenterComment } from '@opentelemetry/sql-common'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { SpanNames } from './enums/SpanNames'; export class PgInstrumentation extends InstrumentationBase { constructor(config: PgInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-pg', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/opentelemetry-instrumentation-pino/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-pino/src/instrumentation.ts index 96a0796cc5..f7dc81f034 100644 --- a/plugins/node/opentelemetry-instrumentation-pino/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-pino/src/instrumentation.ts @@ -27,7 +27,7 @@ import { safeExecuteInTheMiddle, } from '@opentelemetry/instrumentation'; import { PinoInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const pinoVersions = ['>=5.14.0 <10']; @@ -39,7 +39,7 @@ const DEFAULT_LOG_KEYS = { export class PinoInstrumentation extends InstrumentationBase { constructor(config: PinoInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-pino', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts index 75ae380965..d62eceaa2c 100644 --- a/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-redis-4/src/instrumentation.ts @@ -30,7 +30,7 @@ import { import { getClientAttributes } from './utils'; import { defaultDbStatementSerializer } from '@opentelemetry/redis-common'; import { RedisInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { SEMATTRS_DB_STATEMENT } from '@opentelemetry/semantic-conventions'; import type { MultiErrorReply } from './internal-types'; @@ -57,7 +57,7 @@ export class RedisInstrumentation extends InstrumentationBase { protected override _config!: RedisInstrumentationConfig; constructor(config: RedisInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-redis-4', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: RedisInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-redis/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-redis/src/instrumentation.ts index 8d6f2ba88d..1d627b5820 100644 --- a/plugins/node/opentelemetry-instrumentation-redis/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-redis/src/instrumentation.ts @@ -25,7 +25,7 @@ import { getTracedInternalSendCommand, } from './utils'; import { RedisInstrumentationConfig } from './types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const DEFAULT_CONFIG: RedisInstrumentationConfig = { requireParentSpan: false, @@ -37,7 +37,7 @@ export class RedisInstrumentation extends InstrumentationBase { protected override _config!: RedisInstrumentationConfig; constructor(config: RedisInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-redis', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } override setConfig(config: RedisInstrumentationConfig = {}) { diff --git a/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts index a00c24ba98..5d4c7f39cb 100644 --- a/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-restify/src/instrumentation.ts @@ -21,7 +21,7 @@ import * as api from '@opentelemetry/api'; import type { Server } from 'restify'; import { LayerType } from './types'; import { AttributeNames } from './enums/AttributeNames'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import * as constants from './constants'; import { InstrumentationBase, @@ -37,11 +37,7 @@ import type { RestifyInstrumentationConfig } from './types'; export class RestifyInstrumentation extends InstrumentationBase { constructor(config: RestifyInstrumentationConfig = {}) { - super( - `@opentelemetry/instrumentation-${constants.MODULE_NAME}`, - VERSION, - config - ); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } private _moduleVersion?: string; diff --git a/plugins/node/opentelemetry-instrumentation-router/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-router/src/instrumentation.ts index fb02262e30..50803ab148 100644 --- a/plugins/node/opentelemetry-instrumentation-router/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-router/src/instrumentation.ts @@ -28,7 +28,7 @@ import * as http from 'http'; import type * as Router from 'router'; import * as types from './internal-types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import * as constants from './constants'; import * as utils from './utils'; import AttributeNames from './enums/AttributeNames'; @@ -36,11 +36,7 @@ import LayerType from './enums/LayerType'; export default class RouterInstrumentation extends InstrumentationBase { constructor(config: InstrumentationConfig = {}) { - super( - `@opentelemetry/instrumentation-${constants.MODULE_NAME}`, - VERSION, - config - ); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } private _moduleVersion?: string; diff --git a/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts index 4d4b1cfcc5..dddb1c0835 100644 --- a/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-winston/src/instrumentation.ts @@ -31,14 +31,14 @@ import type { Winston3LogMethod, Winston3Logger, } from './internal-types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const winston3Versions = ['>=3 <4']; const winstonPre3Versions = ['>=1 <3']; export class WinstonInstrumentation extends InstrumentationBase { constructor(config: WinstonInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-winston', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } protected init() { diff --git a/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts index f3837177a0..cdde8cfefd 100644 --- a/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts @@ -39,7 +39,7 @@ import { ResourceFetchCustomAttributeFunction, } from './types'; import { AttributeNames } from './enums/AttributeNames'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import { SEMATTRS_HTTP_URL, SEMATTRS_HTTP_USER_AGENT, @@ -62,7 +62,7 @@ export class DocumentLoadInstrumentation extends InstrumentationBase { * @param config */ constructor(config: DocumentLoadInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-document-load', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init() {} diff --git a/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts index 7b17907a89..b77bae7a65 100644 --- a/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-long-task/src/instrumentation.ts @@ -16,7 +16,7 @@ import { hrTime } from '@opentelemetry/core'; import { diag } from '@opentelemetry/api'; import { InstrumentationBase } from '@opentelemetry/instrumentation'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; import type { PerformanceLongTaskTiming, LongtaskInstrumentationConfig, @@ -25,7 +25,7 @@ import type { const LONGTASK_PERFORMANCE_TYPE = 'longtask'; export class LongTaskInstrumentation extends InstrumentationBase { - readonly version: string = VERSION; + readonly version: string = PACKAGE_VERSION; private _observer?: PerformanceObserver; override _config!: LongtaskInstrumentationConfig; @@ -35,7 +35,7 @@ export class LongTaskInstrumentation extends InstrumentationBase { * @param config */ constructor(config: LongtaskInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-long-task', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); } init() {} diff --git a/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts b/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts index ea05bddbf1..4a502b7051 100644 --- a/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts +++ b/plugins/web/opentelemetry-instrumentation-user-interaction/src/instrumentation.ts @@ -34,7 +34,7 @@ import { WindowWithZone, ZoneTypeWithPrototype, } from './internal-types'; -import { VERSION } from './version'; +import { PACKAGE_NAME, PACKAGE_VERSION } from './version'; const ZONE_CONTEXT_KEY = 'OT_ZONE_CONTEXT'; const EVENT_NAVIGATION_NAME = 'Navigation:'; @@ -50,7 +50,7 @@ function defaultShouldPreventSpanCreation() { * addEventListener of HTMLElement */ export class UserInteractionInstrumentation extends InstrumentationBase { - readonly version = VERSION; + readonly version = PACKAGE_VERSION; readonly moduleName: string = 'user-interaction'; private _spansData = new WeakMap(); private _zonePatched?: boolean; @@ -68,7 +68,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase { private _shouldPreventSpanCreation: ShouldPreventSpanCreation; constructor(config: UserInteractionInstrumentationConfig = {}) { - super('@opentelemetry/instrumentation-user-interaction', VERSION, config); + super(PACKAGE_NAME, PACKAGE_VERSION, config); this._eventNames = new Set(config?.eventNames ?? DEFAULT_EVENT_NAMES); this._shouldPreventSpanCreation = typeof config?.shouldPreventSpanCreation === 'function' diff --git a/plugins/web/opentelemetry-plugin-react-load/src/BaseOpenTelemetryComponent.ts b/plugins/web/opentelemetry-plugin-react-load/src/BaseOpenTelemetryComponent.ts index 9b46621027..fa7b007d0a 100644 --- a/plugins/web/opentelemetry-plugin-react-load/src/BaseOpenTelemetryComponent.ts +++ b/plugins/web/opentelemetry-plugin-react-load/src/BaseOpenTelemetryComponent.ts @@ -19,7 +19,7 @@ import { isWrapped } from '@opentelemetry/core'; import * as shimmer from 'shimmer'; import { AttributeNames } from './enums/AttributeNames'; import * as React from 'react'; -import { VERSION } from './version'; +import { PACKAGE_VERSION } from './version'; import { RenderFunction, ComponentDidMountFunction, @@ -58,7 +58,7 @@ export class BaseOpenTelemetryComponent extends React.Component { static setTracer(name: string, version?: string): void { BaseOpenTelemetryComponent._tracer = api.trace.getTracer( name, - version ? version : VERSION + version ? version : PACKAGE_VERSION ); } @@ -423,7 +423,7 @@ export class BaseOpenTelemetryComponent extends React.Component { BaseOpenTelemetryComponent._logger.debug( 'applying patch to', this.moduleName, - VERSION + PACKAGE_VERSION ); if (isWrapped(this.render)) { @@ -536,7 +536,7 @@ export class BaseOpenTelemetryComponent extends React.Component { BaseOpenTelemetryComponent._logger.debug( 'removing patch from', this.moduleName, - VERSION + PACKAGE_VERSION ); shimmer.unwrap(this, 'render'); diff --git a/scripts/version-update.js b/scripts/version-update.js index 77a4969bca..8b56a54b18 100644 --- a/scripts/version-update.js +++ b/scripts/version-update.js @@ -40,7 +40,8 @@ const content = `/* */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '${pjson.version}'; +export const PACKAGE_VERSION = '${pjson.version}'; +export const PACKAGE_NAME = '${pjson.name}'; `; const fileUrl = path.join(appRoot, 'src', 'version.ts')