@opentelemetry/instrumentation-mysql
Advanced tools
Comparing version 0.38.0 to 0.38.1
@@ -26,3 +26,3 @@ "use strict"; | ||
class MySQLInstrumentation extends instrumentation_1.InstrumentationBase { | ||
constructor(config) { | ||
constructor(config = {}) { | ||
super('@opentelemetry/instrumentation-mysql', version_1.VERSION, config); | ||
@@ -45,3 +45,2 @@ this._setMetricInstruments(); | ||
new instrumentation_1.InstrumentationNodeModuleDefinition('mysql', ['2.*'], (moduleExports) => { | ||
api_1.diag.debug('Patching mysql.createConnection'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.createConnection)) { | ||
@@ -51,3 +50,2 @@ this._unwrap(moduleExports, 'createConnection'); | ||
this._wrap(moduleExports, 'createConnection', this._patchCreateConnection()); | ||
api_1.diag.debug('Patching mysql.createPool'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.createPool)) { | ||
@@ -57,3 +55,2 @@ this._unwrap(moduleExports, 'createPool'); | ||
this._wrap(moduleExports, 'createPool', this._patchCreatePool()); | ||
api_1.diag.debug('Patching mysql.createPoolCluster'); | ||
if ((0, instrumentation_1.isWrapped)(moduleExports.createPoolCluster)) { | ||
@@ -77,3 +74,2 @@ this._unwrap(moduleExports, 'createPoolCluster'); | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql createConnection'); | ||
return function createConnection(_connectionUri) { | ||
@@ -91,3 +87,2 @@ const originalResult = originalCreateConnection(...arguments); | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql createPool'); | ||
return function createPool(_config) { | ||
@@ -106,3 +101,2 @@ const pool = originalCreatePool(...arguments); | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql pool end'); | ||
return function end(callback) { | ||
@@ -129,3 +123,2 @@ const nAll = pool._allConnections.length; | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql createPoolCluster'); | ||
return function createPool(_config) { | ||
@@ -143,3 +136,2 @@ const cluster = originalCreatePoolCluster(...arguments); | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql pool cluster add'); | ||
return function add(id, config) { | ||
@@ -167,3 +159,2 @@ // Unwrap if unpatch has been called | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation#patch: patched mysql pool getConnection'); | ||
return function getConnection(arg1, arg2, arg3) { | ||
@@ -210,3 +201,2 @@ // Unwrap if unpatch has been called | ||
const thisPlugin = this; | ||
api_1.diag.debug('MySQLInstrumentation: patched mysql query'); | ||
return function query(query, _valuesOrCallback, _callback) { | ||
@@ -213,0 +203,0 @@ if (!thisPlugin['_enabled']) { |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.38.0"; | ||
export declare const VERSION = "0.38.1"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.38.0'; | ||
exports.VERSION = '0.38.1'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/instrumentation-mysql", | ||
"version": "0.38.0", | ||
"version": "0.38.1", | ||
"description": "OpenTelemetry mysql automatic instrumentation package.", | ||
@@ -67,3 +67,3 @@ "main": "build/src/index.js", | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql#readme", | ||
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973" | ||
"gitHead": "a2e2b5a1aa2910b903829d215184c43d2107b9ac" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74637
547