-
Notifications
You must be signed in to change notification settings - Fork 181
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(database monitor): handles multi-region and connection pooling #3685
Conversation
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
packages/database-monitor/src/observability/prometheusMetrics.ts
Outdated
Show resolved
Hide resolved
GROUP BY status; | ||
` | ||
) | ||
const remainingWebhookStatus = new Set(Array(4).keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: This hard codes the domain logic that there are only 4 webhook status. If it ever changes this breaks.
GROUP BY "previewStatus"; | ||
`) | ||
|
||
const remainingPreviewStatus = new Set(Array(4).keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: This hard codes the domain logic that there are only 4 webhook status. If it ever changes this breaks.
return { | ||
start: () => { | ||
const intervalId = setInterval(() => { | ||
void (async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: setInterval cannot be async, so we can't await the call. (or is there a better way of achieving this?)
register: prometheusClient.register, | ||
collectionPeriodMilliseconds: databaseMonitorCollectionPeriodSeconds() * 1000, | ||
config: { | ||
getDbClients, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to pass in getDbClients
from elsewhere?
(minor change, can be in a different PR if at all)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will probably adjust this if & when we add tests to better help dependency injection in test environments, but no need for now.
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
…tric with the metric definition
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
- as database monitor tries to monitor all configured databases, there may be unregistered databases which are not yet migrated and do not have the required tables - many of the queries are multi-region and now query all database clients
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
Description & motivation
This addresses two features with the existing database monitor:
Changes:
databaseName
as a paramater. This allows it to gather data on the database size. If it does not exist, will log a warning and continue.To-do before merge:
Screenshots:
Validation of changes:
Checklist:
References