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(NODE-5169): Implement emergency logger #3610

Merged
merged 48 commits into from Apr 14, 2023

Conversation

W-A-James
Copy link
Contributor

@W-A-James W-A-James commented Mar 27, 2023

Description

What is changing?

  • Implement MongoLogger.emergency severity logger, the private MongoLogger.log method and related private helpers
  • Change the requirement for MongoLoggerMongoClientOptions.mongodbLogPath to be a MongoDBLogWritable
  • All command monitoring and connection monitoring events now have a public name field.
  • ConnectionClosedEvent's constructor now takes in an optional error that is used in the logger
  • Adds a new integration test to ensure that the redaction of sensitive commands in the CommandXXXXEvent constructors works when the events are passed to the logger.
Is there new documentation needed for these changes?

No

What is the motivation for this change?

Get initial implementation of one severity logging method complete to enable quick completion of the remainder of the logging methods

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

src/mongo_logger.ts Outdated Show resolved Hide resolved
src/mongo_logger.ts Outdated Show resolved Hide resolved
@W-A-James W-A-James changed the title refactor(NODE-4813): WIP feat(NODE-5169): Implement emergency logger Apr 4, 2023
…onfig feature flag and remove strict writable requirement for log sink in mongologger
@W-A-James W-A-James requested a review from nbbeeken April 12, 2023 15:59
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Apr 12, 2023
src/cmap/connection_pool_events.ts Show resolved Hide resolved
src/constants.ts Outdated
@@ -23,16 +23,27 @@ export const SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged' as const;
export const TOPOLOGY_OPENING = 'topologyOpening' as const;
export const TOPOLOGY_CLOSED = 'topologyClosed' as const;
export const TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged' as const;
/** @public */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do we need to export our constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done since the the name property that we have on our Command Events and ConnectionPool Events is public so we need to have these constants exported. I'm open to doing this in a more elegant way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well one option is to make the name property on the command events internal. There's no reason it needs to be public, right? It's only used by the logger.

src/utils.ts Show resolved Hide resolved
src/mongo_logger.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp April 13, 2023 15:59
src/cmap/command_monitoring_events.ts Show resolved Hide resolved
src/cmap/connection_pool_events.ts Show resolved Hide resolved
src/cmap/connection_pool_events.ts Outdated Show resolved Hide resolved
src/mongo_logger.ts Outdated Show resolved Hide resolved
src/cmap/connection_pool.ts Outdated Show resolved Hide resolved
src/cmap/connection_pool_events.ts Outdated Show resolved Hide resolved
@W-A-James W-A-James requested a review from nbbeeken April 14, 2023 18:15
@nbbeeken nbbeeken merged commit d502eb0 into main Apr 14, 2023
16 of 21 checks passed
@nbbeeken nbbeeken deleted the NODE-4813/Implement_severity_logging_methods branch April 14, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
4 participants