diff --git a/package-lock.json b/package-lock.json index f50df50692..18f942de96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26284,11 +26284,10 @@ } }, "node_modules/mysql2": { - "version": "3.11.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.3.tgz", - "integrity": "sha512-Qpu2ADfbKzyLdwC/5d4W7+5Yz7yBzCU05YWt5npWzACST37wJsB23wgOSo00qi043urkiRwXtEvJc9UnuLX/MQ==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.5.tgz", + "integrity": "sha512-0XFu8rUmFN9vC0ME36iBvCUObftiMHItrYFhlCRvFWbLgpNqtC4Br/NmZX1HNCszxT0GGy5QtP+k3Q3eCJPaYA==", "dev": true, - "license": "MIT", "dependencies": { "aws-ssl-profiles": "^1.1.1", "denque": "^2.1.0", @@ -37853,7 +37852,7 @@ "@types/mocha": "7.0.2", "@types/node": "18.18.14", "@types/semver": "7.5.8", - "mysql2": "3.11.3", + "mysql2": "3.11.5", "nyc": "15.1.0", "rimraf": "5.0.10", "semver": "7.6.3", @@ -48554,7 +48553,7 @@ "@types/mocha": "7.0.2", "@types/node": "18.18.14", "@types/semver": "7.5.8", - "mysql2": "3.11.3", + "mysql2": "3.11.5", "nyc": "15.1.0", "rimraf": "5.0.10", "semver": "7.6.3", @@ -63019,9 +63018,9 @@ } }, "mysql2": { - "version": "3.11.3", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.3.tgz", - "integrity": "sha512-Qpu2ADfbKzyLdwC/5d4W7+5Yz7yBzCU05YWt5npWzACST37wJsB23wgOSo00qi043urkiRwXtEvJc9UnuLX/MQ==", + "version": "3.11.5", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.11.5.tgz", + "integrity": "sha512-0XFu8rUmFN9vC0ME36iBvCUObftiMHItrYFhlCRvFWbLgpNqtC4Br/NmZX1HNCszxT0GGy5QtP+k3Q3eCJPaYA==", "dev": true, "requires": { "aws-ssl-profiles": "^1.1.1", diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/package.json b/plugins/node/opentelemetry-instrumentation-mysql2/package.json index dcf3806e56..20de228c25 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/package.json +++ b/plugins/node/opentelemetry-instrumentation-mysql2/package.json @@ -50,7 +50,7 @@ "@types/mocha": "7.0.2", "@types/node": "18.18.14", "@types/semver": "7.5.8", - "mysql2": "3.11.3", + "mysql2": "3.11.5", "nyc": "15.1.0", "rimraf": "5.0.10", "semver": "7.6.3", diff --git a/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts b/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts index 7557cf7a01..60983abeb1 100644 --- a/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts +++ b/plugins/node/opentelemetry-instrumentation-mysql2/src/instrumentation.ts @@ -55,8 +55,9 @@ export class MySQL2Instrumentation extends InstrumentationBase=1.4.2 <4'], (moduleExports: any) => { - const ConnectionPrototype: mysqlTypes.Connection = - moduleExports.Connection.prototype; + const ConnectionPrototype = + this._getConnectionPrototype(moduleExports); + if (isWrapped(ConnectionPrototype.query)) { this._unwrap(ConnectionPrototype, 'query'); } @@ -79,8 +80,8 @@ export class MySQL2Instrumentation extends InstrumentationBase { if (moduleExports === undefined) return; - const ConnectionPrototype: mysqlTypes.Connection = - moduleExports.Connection.prototype; + const ConnectionPrototype = + this._getConnectionPrototype(moduleExports); this._unwrap(ConnectionPrototype, 'query'); this._unwrap(ConnectionPrototype, 'execute'); } @@ -210,4 +211,16 @@ export class MySQL2Instrumentation extends InstrumentationBase