Skip to content

Commit 76cb3a3

Browse files
committed
migrating tedious to use runStores
1 parent 18057b1 commit 76cb3a3

File tree

1 file changed

+10
-10
lines changed
  • packages/datadog-plugin-tedious/src

1 file changed

+10
-10
lines changed

packages/datadog-plugin-tedious/src/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ class TediousPlugin extends DatabasePlugin {
88
static get operation () { return 'request' } // TODO: change to match other database plugins
99
static get system () { return 'mssql' }
1010

11-
bindStart (payload) {
11+
bindStart (ctx) {
1212
const service = this.serviceName({ pluginConfig: this.config, system: this.system })
1313
const span = this.startSpan(this.operationName(), {
1414
service,
15-
resource: payload.queryOrProcedure,
15+
resource: ctx.queryOrProcedure,
1616
type: 'sql',
1717
kind: 'client',
1818
meta: {
1919
'db.type': 'mssql',
2020
component: 'tedious',
21-
'out.host': payload.connectionConfig.server,
22-
[CLIENT_PORT_KEY]: payload.connectionConfig.options.port,
23-
'db.user': payload.connectionConfig.userName || payload.connectionConfig.authentication.options.userName,
24-
'db.name': payload.connectionConfig.options.database,
25-
'db.instance': payload.connectionConfig.options.instanceName
21+
'out.host': ctx.connectionConfig.server,
22+
[CLIENT_PORT_KEY]: ctx.connectionConfig.options.port,
23+
'db.user': ctx.connectionConfig.userName || ctx.connectionConfig.authentication.options.userName,
24+
'db.name': ctx.connectionConfig.options.database,
25+
'db.instance': ctx.connectionConfig.options.instanceName
2626
}
27-
}, payload)
27+
}, ctx)
2828

2929
// SQL Server includes comments when caching queries
3030
// For that reason we allow service mode but not full mode
31-
payload.sql = this.injectDbmQuery(span, payload.queryOrProcedure, service, true)
32-
return payload.currentStore
31+
ctx.sql = this.injectDbmQuery(span, ctx.queryOrProcedure, service, true)
32+
return ctx.currentStore
3333
}
3434
}
3535

0 commit comments

Comments
 (0)