-
Notifications
You must be signed in to change notification settings - Fork 91
feat(mongodb): alert when compaction is needed #2433
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
base: development/2.15
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,15 @@ x-inputs: | |
| - name: replicationLagOplogSizeThreshold | ||
| type: config | ||
| value: 0.5 | ||
| - name: compactionDiskUsageThreshold | ||
| type: config | ||
| value: 0.7 | ||
| - name: compactionFreeStorageRatioThreshold | ||
| type: config | ||
| value: 0.3 | ||
| - name: compactionFreeStorageAbsoluteThreshold | ||
| type: config | ||
| value: 10 * 1024 * 1024 * 1024 # 10 GiB, in bytes | ||
|
|
||
| groups: | ||
| - name: MongoDb | ||
|
|
@@ -270,6 +279,27 @@ groups: | |
| description: "MongoDB pod `{{ $labels.pod }}` has been in the 'STARTUP2' state for more than 1 hour. Please ensure that the instance is running properly." | ||
| summary: MongoDB node in STARTUP2 state for too long | ||
|
|
||
| - alert: MongoDbCompactionNeeded | ||
| expr: | | ||
| ( | ||
| mongodb_dbstats_fsUsedSize{namespace="${namespace}",pod=~"${service}.*"} | ||
| / mongodb_dbstats_fsTotalSize{namespace="${namespace}",pod=~"${service}.*"} | ||
| ) > ${compactionDiskUsageThreshold} | ||
| and | ||
| ( | ||
| mongodb_dbstats_totalFreeStorageSize{namespace="${namespace}",pod=~"${service}.*"} | ||
| / mongodb_dbstats_totalSize{namespace="${namespace}",pod=~"${service}.*"} | ||
| ) > ${compactionFreeStorageRatioThreshold} | ||
|
Comment on lines
+285
to
+292
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure about this rule : percentage of disk (FS) and percentage of reclaimable (I gather totalFreeStorageSize is what we can reclaim?) could fire in many case, but often when not relevant ? e.g. we are interested when the reclaimable amount is significant vs the available mongodb (free/total) size I guess?
|
||
| and | ||
| mongodb_dbstats_totalFreeStorageSize{namespace="${namespace}",pod=~"${service}.*"} | ||
| > ${compactionFreeStorageAbsoluteThreshold} | ||
| for: 1h | ||
| labels: | ||
| severity: warning | ||
| annotations: | ||
| description: "MongoDB pod `{{ $labels.pod }}` database `{{ $labels.database }}` has accumulated significant reclaimable storage while the underlying filesystem is filling up. Consider running compaction to recover disk space." | ||
| summary: MongoDB compaction needed | ||
|
|
||
| - alert: MongoDbRSNotSynced | ||
| expr: | | ||
| count by (rs_nm, statefulset) ( | ||
|
|
||
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.
are we confident about these
levels?these alerts need to be "low touch", and fire only when an action is required...
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: since we add config, shoud add matching options in ZKOP afterwards, to allow setting them...)