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: adds alerts for thin pool usage #151

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions config/prometheus/prometheus_rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,41 @@
"for": "5m"
"labels":
"severity": "critical"
- "name": "thin-pool-alert.rules"
"rules":
- "alert": "ThinPoolDataUsageAtThresholdNearFull"
"annotations":
"description": "Thin pool in the VolumeGroup is nearing full. Data deletion or thin pool expansion is required."
"message": "Thin Pool data utilization in the VolumeGroup {{ $labels.device_class }} has crossed 75 % on node {{ $labels.node }}. Free up some space or expand the thin pool."
"expr": |
topolvm_thinpool_data_percent > 75.00 and topolvm_thinpool_data_percent < 85.00
"for": "5m"
"labels":
"severity": "warning"
- "alert": "ThinPoolDataUsageAtThresholdCritical"
"annotations":
"description": "Thin pool in the VolumeGroup is critically full. Data deletion or thin pool expansion is required."
"message": "Thin Pool data utilization in the VolumeGroup {{ $labels.device_class }} has crossed 85 % on node {{ $labels.node }}. Free up some space or expand the thin pool immediately."
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this generated by the jsonnet? I don't see any changes to the libsonnet file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. These changes are in the monitoring/alerts/vgalerts.libsonnet file.

"expr": |
topolvm_thinpool_data_percent > 85.00
"for": "5m"
"labels":
"severity": "critical"
- "alert": "ThinPoolMetaDataUsageAtThresholdNearFull"
"annotations":
"description": "Thin pool metadata utitlization in the VolumeGroup is nearing full. Data deletion or thin pool expansion is required."
"message": "Thin Pool metadata utilization in the VolumeGroup {{ $labels.device_class }} has crossed 75 % on node {{ $labels.node }}. Free up some space or expand the thin pool."
"expr": |
topolvm_thinpool_metadata_percent > 75.00 and topolvm_thinpool_data_percent < 85.00
"for": "5m"
"labels":
"severity": "warning"
- "alert": "ThinPoolMetaDataUsageAtThresholdCritical"
"annotations":
"description": "Thin pool metadata ultilization in the VolumeGroup is critically full. Data deletion or thin pool expansion is required."
"message": "Thin Pool metadata utilization in the VolumeGroup {{ $labels.device_class }} has crossed 85 % on node {{ $labels.node }}. Free up some space or expand the thin pool immediately."
"expr": |
topolvm_thinpool_metadata_percent > 85.00
"for": "5m"
"labels":
"severity": "critical"
61 changes: 61 additions & 0 deletions monitoring/alerts/vgalerts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,67 @@
},
],
},
{
name: 'thin-pool-alert.rules',
rules: [
{
alert: 'ThinPoolDataUsageAtThresholdNearFull',
expr: |||
topolvm_thinpool_data_percent > %(thinPoolUsageThresholdNearFull)0.2f and topolvm_thinpool_data_percent < %(thinPoolUsageThresholdCritical)0.2f
||| % $._config,
'for': $._config.thinPoolUsageThresholdAlertTime,
labels: {
severity: 'warning',
},
annotations: {
description: 'Thin pool in the VolumeGroup is nearing full. Data deletion or thin pool expansion is required.',
message: 'Thin Pool data utilization in the VolumeGroup {{ $labels.device_class }} has crossed %.0f %% on node {{ $labels.node }}. Free up some space or expand the thin pool.' % ($._config.thinPoolUsageThresholdNearFull),
},
},
{
alert: 'ThinPoolDataUsageAtThresholdCritical',
expr: |||
topolvm_thinpool_data_percent > %(thinPoolUsageThresholdCritical)0.2f
||| % $._config,
'for': $._config.thinPoolUsageThresholdAlertTime,
labels: {
severity: 'critical',
},
annotations: {
description: 'Thin pool in the VolumeGroup is critically full. Data deletion or thin pool expansion is required.',
message: 'Thin Pool data utilization in the VolumeGroup {{ $labels.device_class }} has crossed %.0f %% on node {{ $labels.node }}. Free up some space or expand the thin pool immediately.' % ($._config.thinPoolUsageThresholdCritical),
},
},
{
alert: 'ThinPoolMetaDataUsageAtThresholdNearFull',
expr: |||
topolvm_thinpool_metadata_percent > %(thinPoolUsageThresholdNearFull)0.2f and topolvm_thinpool_data_percent < %(thinPoolUsageThresholdCritical)0.2f
||| % $._config,
'for': $._config.thinPoolUsageThresholdAlertTime,
labels: {
severity: 'warning',
},
annotations: {
description: 'Thin pool metadata utitlization in the VolumeGroup is nearing full. Data deletion or thin pool expansion is required.',
message: 'Thin Pool metadata utilization in the VolumeGroup {{ $labels.device_class }} has crossed %.0f %% on node {{ $labels.node }}. Free up some space or expand the thin pool.' % ($._config.thinPoolUsageThresholdNearFull),
},
},
{
alert: 'ThinPoolMetaDataUsageAtThresholdCritical',
expr: |||
topolvm_thinpool_metadata_percent > %(thinPoolUsageThresholdCritical)0.2f
||| % $._config,
'for': $._config.thinPoolUsageThresholdAlertTime,
labels: {
severity: 'critical',
},
annotations: {
description: 'Thin pool metadata ultilization in the VolumeGroup is critically full. Data deletion or thin pool expansion is required.',
message: 'Thin Pool metadata utilization in the VolumeGroup {{ $labels.device_class }} has crossed %.0f %% on node {{ $labels.node }}. Free up some space or expand the thin pool immediately.' % ($._config.thinPoolUsageThresholdCritical),
},
},
],
},
],
},
}
10 changes: 9 additions & 1 deletion monitoring/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

// alert durations
volumegroupUsageThresholdAlertTime: '5m',

// thin pool data and metadata usage percentage threshold near full
thinPoolUsageThresholdNearFull : 75,

// thin pool data and metadata usage percentage threshold critical
thinPoolUsageThresholdCritical : 85,

// alert durations
thinPoolUsageThresholdAlertTime: '5m',
},
}