Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(NODE-5613): add awaited field to SDAM heartbeat events #3895

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

durran
Copy link
Member

@durran durran commented Oct 17, 2023

Description

Adds an awaited field to server heartbeat events.

What is changing?

  • Adds the awaited field and sets it to true when using the streaming protocol.
  • Tests will come as part of NODE-5197
Is there new documentation needed for these changes?

None

What is the motivation for this change?

Need the field to pass tests coming in NODE-5197

Release Highlight

Server heartbeat events now contain an awaited field that is true when using the streaming protocol.

const client = new MongoClient(process.env.MONGODB_URI);
client.on('serverHeartbeatStarted', (event) => {
  console.log(event.awaited);
});
client.on('serverHeartbeatSucceeded', (event) => {
  console.log(event.awaited);
});
client.on('serverHeartbeatFailed', (event) => {
  console.log(event.awaited);
});

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

@baileympearson baileympearson self-assigned this Oct 17, 2023
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Oct 17, 2023
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

@durran
Copy link
Member Author

durran commented Oct 17, 2023

We also need the awaited field on HeartbeatSucceeded and HeartbeatFailed events: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-logging-and-monitoring.rst#events-api

Good catch. I've updated.

@durran durran requested a review from baileympearson October 17, 2023 14:30
@baileympearson baileympearson added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Oct 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Team Review Needs review from team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants