File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
plugins/node/opentelemetry-instrumentation-mysql2/src Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,9 @@ export function getConnectionPrototypeToInstrument(connection: any) {
153153
154154 // [email protected] included a refactoring, where most code was moved out of the `Connection` class and into a shared base 155155 // so we need to instrument that instead, see https://github.com/sidorares/node-mysql2/pull/3081
156- if ( basePrototype ?. constructor ?. name === 'BaseConnection' ) {
156+ // This checks if the functions we're instrumenting are there on the base - we cannot use the presence of a base
157+ // prototype since EventEmitter is the base for mysql2@<=3.11.4
158+ if ( typeof basePrototype ?. query === 'function' && typeof basePrototype ?. execute === 'function' ) {
157159 return basePrototype ;
158160 }
159161
You can’t perform that action at this time.
0 commit comments