From 12a8da885b581288bbe6f857a6fc538c1c8fb0a8 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Thu, 15 Aug 2024 12:42:17 -0400 Subject: [PATCH] fix mariadb --- packages/datadog-instrumentations/src/mariadb.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/datadog-instrumentations/src/mariadb.js b/packages/datadog-instrumentations/src/mariadb.js index 2afe5928c8..28affcaf81 100644 --- a/packages/datadog-instrumentations/src/mariadb.js +++ b/packages/datadog-instrumentations/src/mariadb.js @@ -119,7 +119,7 @@ function createWrapQueryCallback (options) { } } -function wrapConnection (Connection, promiseMethod) { +function wrapConnection (promiseMethod, Connection) { return function (options) { Connection.apply(this, arguments) @@ -170,13 +170,13 @@ addHook({ name, file: 'lib/pool.js', versions: ['>=3'] }, (Pool) => { }) addHook({ name, file: 'lib/connection.js', versions: ['>=2.5.2 <3'] }, (Connection) => { - return shimmer.wrap(Connection, wrapConnection(Connection, '_queryPromise')) + return shimmer.wrapFunction(Connection, wrapConnection.bind(null, '_queryPromise')) }) addHook({ name, file: 'lib/connection.js', versions: ['>=2.0.4 <=2.5.1'] }, (Connection) => { - return shimmer.wrap(Connection, wrapConnection(Connection, 'query')) + return shimmer.wrapFunction(Connection, wrapConnection.bind(null, 'query')) }) addHook({ name, file: 'lib/pool-base.js', versions: ['>=2.0.4 <3'] }, (PoolBase) => { - return shimmer.wrap(PoolBase, wrapPoolBase(PoolBase)) + return shimmer.wrapFunction(PoolBase, wrapPoolBase) })