Skip to content

Commit 88b4474

Browse files
committed
fix: check existence of functions on prototype instead
1 parent 2968836 commit 88b4474

File tree

1 file changed

+2
-1
lines changed
  • plugins/node/opentelemetry-instrumentation-mysql2/src

1 file changed

+2
-1
lines changed

plugins/node/opentelemetry-instrumentation-mysql2/src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ export function getConnectionPrototypeToInstrument(connection: any) {
155155
// so we need to instrument that instead, see https://github.com/sidorares/node-mysql2/pull/3081
156156
// This checks if the functions we're instrumenting are there on the base - we cannot use the presence of a base
157157
// prototype since EventEmitter is the base for mysql2@<=3.11.4
158-
if (typeof basePrototype?.query === 'function' && typeof basePrototype?.execute === 'function') {
158+
if (typeof basePrototype?.query === 'function'
159+
&& typeof basePrototype?.execute === 'function') {
159160
return basePrototype;
160161
}
161162

0 commit comments

Comments
 (0)