Skip to content

Commit a081cdf

Browse files
fix: Attach mysql tracing to Connection.createQuery instead of Connection.prototype.query (#3353)
1 parent 9af3095 commit a081cdf

File tree

1 file changed

+2
-4
lines changed
  • packages/tracing/src/integrations

1 file changed

+2
-4
lines changed

packages/tracing/src/integrations/mysql.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { EventProcessor, Integration } from '@sentry/types';
33
import { dynamicRequire, fill, logger } from '@sentry/utils';
44

55
interface MysqlConnection {
6-
prototype: {
7-
query: () => void;
8-
};
6+
createQuery: () => void;
97
}
108

119
/** Tracing integration for node-mysql package */
@@ -38,7 +36,7 @@ export class Mysql implements Integration {
3836
// function (callback) => void
3937
// function (options, callback) => void
4038
// function (options, values, callback) => void
41-
fill(connection.prototype, 'query', function(orig: () => void) {
39+
fill(connection, 'createQuery', function(orig: () => void) {
4240
return function(this: unknown, options: unknown, values: unknown, callback: unknown) {
4341
const scope = getCurrentHub().getScope();
4442
const parentSpan = scope?.getSpan();

0 commit comments

Comments
 (0)