Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Updated cassandra-driver instrumentation to properly trace promise based executions #2351

Merged
11 changes: 7 additions & 4 deletions lib/instrumentation/cassandra-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
ClientProto,
['connect', 'shutdown'],
function operationSpec(shim, _fn, name) {
return new OperationSpec({ callback: shim.LAST, name })
return new OperationSpec({ callback: shim.LAST, name, promise: true })
}
)

Expand All @@ -39,7 +39,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
'_execute',
new QuerySpec({
query: shim.FIRST,
callback: shim.LAST
callback: shim.LAST,
promise: true
})
)

Expand All @@ -64,7 +65,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
'_innerExecute',
new QuerySpec({
query: shim.FIRST,
callback: shim.LAST
callback: shim.LAST,
promise: true
})
)

Expand Down Expand Up @@ -109,7 +111,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
'batch',
new QuerySpec({
query: findBatchQueryArg,
callback: shim.LAST
callback: shim.LAST,
promise: true
})
)
}
Expand Down
Loading
Loading