Skip to content

Commit

Permalink
fix: Updated cassandra-driver instrumentation to properly trace promi…
Browse files Browse the repository at this point in the history
…se based executions (#2351)
  • Loading branch information
svetlanabrennan authored Jul 17, 2024
1 parent d212b15 commit bab9a8b
Show file tree
Hide file tree
Showing 2 changed files with 208 additions and 136 deletions.
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

0 comments on commit bab9a8b

Please sign in to comment.