Skip to content

Commit

Permalink
chore(mongo): make code more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
haddasbronfman committed Dec 6, 2022
1 parent 0b96a62 commit 58b8e8c
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,9 @@ export class MongoDBInstrumentation extends InstrumentationBase {
const span = instrumentation.tracer.startSpan(`mongodb.${type}`, {
kind: SpanKind.CLIENT,
});
instrumentation._populateV3Attributes(
span,
ns,
server,
cmd,
commandType === MongodbCommandType.UNKNOWN ? undefined : commandType
);
const operation =
commandType === MongodbCommandType.UNKNOWN ? undefined : commandType;
instrumentation._populateV3Attributes(span, ns, server, cmd, operation);
const patchedCallback = instrumentation._patchEnd(span, resultHandler);
// handle when options is the callback to send the correct number of args
if (typeof options === 'function') {
Expand Down

0 comments on commit 58b8e8c

Please sign in to comment.