Skip to content

Commit bab9a8b

Browse files
fix: Updated cassandra-driver instrumentation to properly trace promise based executions (#2351)
1 parent d212b15 commit bab9a8b

File tree

2 files changed

+208
-136
lines changed

2 files changed

+208
-136
lines changed

lib/instrumentation/cassandra-driver.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
2929
ClientProto,
3030
['connect', 'shutdown'],
3131
function operationSpec(shim, _fn, name) {
32-
return new OperationSpec({ callback: shim.LAST, name })
32+
return new OperationSpec({ callback: shim.LAST, name, promise: true })
3333
}
3434
)
3535

@@ -39,7 +39,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
3939
'_execute',
4040
new QuerySpec({
4141
query: shim.FIRST,
42-
callback: shim.LAST
42+
callback: shim.LAST,
43+
promise: true
4344
})
4445
)
4546

@@ -64,7 +65,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
6465
'_innerExecute',
6566
new QuerySpec({
6667
query: shim.FIRST,
67-
callback: shim.LAST
68+
callback: shim.LAST,
69+
promise: true
6870
})
6971
)
7072

@@ -109,7 +111,8 @@ module.exports = function initialize(_agent, cassandra, _moduleName, shim) {
109111
'batch',
110112
new QuerySpec({
111113
query: findBatchQueryArg,
112-
callback: shim.LAST
114+
callback: shim.LAST,
115+
promise: true
113116
})
114117
)
115118
}

0 commit comments

Comments
 (0)