Skip to content

Commit

Permalink
cr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nozik committed Aug 30, 2021
1 parent c93e767 commit 05ddd96
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -410,11 +410,11 @@ export class MongoDBInstrumentation extends InstrumentationBase<

// capture parameters within the query as well if enhancedDatabaseReporting is enabled.
const commandObj = command.query ?? command.q ?? command;
const dbStatementSerializer: DbStatementSerializer =
this._config.dbStatementSerializer ||
const dbStatementSerializer =
typeof this._config.dbStatementSerializer === 'function' ?
this._config.dbStatementSerializer :
this._defaultDbStatementSerializer.bind(this);

if (typeof dbStatementSerializer === 'function') {
safeExecuteInTheMiddle(
() => {
const query = dbStatementSerializer(commandObj);
Expand All @@ -427,7 +427,6 @@ export class MongoDBInstrumentation extends InstrumentationBase<
},
true
);
}
}

private _defaultDbStatementSerializer(commandObj: Record<string, unknown>) {
Expand Down

0 comments on commit 05ddd96

Please sign in to comment.