Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connection): bubble up monitorCommands events to Mongoose connection if monitorCommands option set #14681

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14611

Summary

MongoDB driver introduced a handy set of commandStarted, commandFailed, commandSucceeded events that are great for monitoring performance. With this PR, we'll bubble those events up to the Mongoose connection if the monitorCommands option is set.

We shouldn't need to add monitorCommands to Mongoose's ConnectOptions because monitorCommands is already an option in MongoDB driver's connection options: https://github.com/mongodb/node-mongodb-native/blob/8fb43f86b22f98e488a3a98c0b562ca240ffdaa1/src/cmap/connection.ts#L118

Examples

@vkarpov15 vkarpov15 added this to the 8.5 milestone Jun 21, 2024
@vkarpov15 vkarpov15 merged commit da15836 into 8.5 Jun 24, 2024
45 of 46 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14611 branch June 24, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants