Skip to content

[instrumentation-mongodb] test failing for [email protected]  #1983

@pichlermarc

Description

@pichlermarc

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

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:

See failing test on main

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpkg:instrumentation-mongodbpriority:p2Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions