From 9c0ed439c877a2e3f57c470d9e59e2cae42f8f57 Mon Sep 17 00:00:00 2001 From: rishabh <7551150+rishabh@users.noreply.github.com> Date: Mon, 1 Jul 2019 23:45:28 -0400 Subject: [PATCH] Move sql mapping to top --- packages/datadog-plugin-tedious/src/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/datadog-plugin-tedious/src/index.js b/packages/datadog-plugin-tedious/src/index.js index 1438002b329..dc21823ae61 100644 --- a/packages/datadog-plugin-tedious/src/index.js +++ b/packages/datadog-plugin-tedious/src/index.js @@ -2,10 +2,15 @@ const Tags = require('../../../ext/tags') const Kinds = require('../../../ext/kinds') - const analyticsSampler = require('../../dd-trace/src/analytics_sampler') const tx = require('../../dd-trace/src/plugins/util/tx') +const sqlMapping = { + 'sp_execute': 'execute', + 'sp_prepare': 'prepare', + 'sp_unprepare': 'unprepare' +} + function createWrapRequestClass (tracer) { return function wrapRequestClass (Request) { class RequestWithTrace extends Request { @@ -101,12 +106,6 @@ function addDatabaseTags (span, connectionConfig) { span.setTag('db.instance', connectionConfig.options.instanceName) } -const sqlMapping = { - 'sp_execute': 'execute', - 'sp_prepare': 'prepare', - 'sp_unprepare': 'unprepare' -} - function addQueryTags (span, request) { const transformedPacketType = request.sqlTextOrProcedure const resourceType = sqlMapping[transformedPacketType] || 'query'