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

fix(server): app initialization starts metrics after multiregion #3697

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

iainsproat
Copy link
Contributor

@iainsproat iainsproat commented Dec 14, 2024

Description & motivation

The knex & high frequency metrics were initialized before the multiregion module. These metrics query clients related to multi-region databases. When getting the clients, they will be initialized if they are not already. This initialization process starts the database migration for the multiregion database.

As metrics runs concurrently, the error would throw at a random time during the startup process and was unrelated to the log messages immediately prior which was confusing.

To avoid confusion the multiregion database migrations should remain the responsibility of the multiregion module.

Screenshot 2024-12-14 at 11 15 42

The application may ultimately run into the same error, but it is then clearer as to what module has encountered the error and for what purpose.

Changes:

  • Prometheus metrics are initialized after the modules have run.

To-do before merge:

Screenshots:

Validation of changes:

  • validated by running locally in multi-region mode, and querying the /metrics endpoint.

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

@iainsproat iainsproat marked this pull request as ready for review December 14, 2024 12:37
@iainsproat iainsproat merged commit 663ee0b into main Dec 16, 2024
26 of 28 checks passed
@iainsproat iainsproat deleted the iain/initialize-metrics-after-multiregion branch December 16, 2024 10:40
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