Skip to content

Commit

Permalink
Move sql mapping to top
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh committed Jul 3, 2019
1 parent acc37a9 commit 9c0ed43
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/datadog-plugin-tedious/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 9c0ed43

Please sign in to comment.