-
Notifications
You must be signed in to change notification settings - Fork 611
Description
Description:
[email protected]
released with a refactor that changed how the internal Connection.command()
works, so no spans are generated and test fail.
In the instrumentation, we heavily rely on command
, see
opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-mongodb/src/instrumentation.ts
Lines 495 to 506 in 2e9fce4
const currentSpan = trace.getSpan(context.active()); | |
const resultHandler = callback; | |
const commandType = Object.keys(cmd)[0]; | |
if ( | |
typeof resultHandler !== 'function' || | |
typeof cmd !== 'object' || | |
cmd.ismaster || | |
cmd.hello | |
) { | |
return original.call(this, ns, cmd, options, callback); | |
} |
Since the signature changed we return original.call()
instead of instrumenting. resultHandler
is undefined
and therefore not a function. also the other args have changed, see below. Right now I think this is not causing problems in end-user apps but if it is, we should temporarily disable [email protected]
instrumentation until a fix is ready.
Resources:
connection.ts
at[email protected]
- worksconnection.ts
at[email protected]
- fails
See failing test on main
- https://github.com/open-telemetry/opentelemetry-js-contrib/actions/runs/8093744773/job/22167022286
- I restarted the test for
18.18.2
onmain
after seeing failures in chore(deps): update deps matching "@opentelemetry/*" #1978