-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor recording rules and alerts code
Following the work started in kubevirt/kubevirt#10044 , and according to the kubevirt/community#219 proposal, this PR refactors monitoring recording rules and alerts Signed-off-by: avlitman <[email protected]>
- Loading branch information
Showing
28 changed files
with
856 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
# SSP Operator metrics | ||
This document aims to help users that are not familiar with metrics exposed by the SSP Operator. | ||
All metrics documented here are auto-generated by the utility tool `tools/metricsdocs` and reflects exactly what is being exposed. | ||
|
||
## SSP Operator Metrics List | ||
### kubevirt_ssp_common_templates_restored_increase | ||
The increase in the number of common templates restored by the operator back to their original state, over the last hour. Type: Gauge. | ||
|
||
### kubevirt_ssp_common_templates_restored_total | ||
The total number of common templates restored by the operator back to their original state. Type: Counter. | ||
|
||
### kubevirt_ssp_operator_reconcile_succeeded | ||
Set to 1 if the reconcile process of all operands completes with no errors, and to 0 otherwise. Type: Gauge. | ||
|
||
### kubevirt_ssp_operator_reconcile_succeeded_aggregated | ||
The total number of ssp-operator pods reconciling with no errors. Type: Gauge. | ||
|
||
### kubevirt_ssp_operator_up | ||
The total number of running ssp-operator pods. Type: Gauge. | ||
|
||
### kubevirt_ssp_template_validator_rejected_increase | ||
The increase in the number of rejected template validators, over the last hour. Type: Gauge. | ||
|
||
### kubevirt_ssp_template_validator_rejected_total | ||
The total number of rejected template validators. Type: Counter. | ||
|
||
### kubevirt_ssp_template_validator_up | ||
The total number of running virt-template-validator pods. Type: Gauge. | ||
|
||
### kubevirt_ssp_vm_rbd_block_volume_without_rxbounce | ||
VM with RBD mounted Block volume (without rxbounce option set). Type: Gauge. | ||
[ALPHA] VM with RBD mounted Block volume (without rxbounce option set). Type: Gauge. | ||
|
||
## Developing new metrics | ||
After developing new metrics or changing old ones, please run `make generate-doc` to regenerate this document. | ||
|
||
All metrics documented here are auto-generated and reflect exactly what is being | ||
exposed. After developing new metrics or changing old ones please regenerate | ||
this document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package alerts | ||
|
||
import ( | ||
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" | ||
"k8s.io/apimachinery/pkg/util/intstr" | ||
"k8s.io/utils/ptr" | ||
) | ||
|
||
const ( | ||
severityAlertLabelKey = "severity" | ||
healthImpactAlertLabelKey = "operator_health_impact" | ||
) | ||
|
||
func operatorAlerts() []promv1.Rule { | ||
return []promv1.Rule{ | ||
{ | ||
Alert: "SSPDown", | ||
Expr: intstr.FromString("kubevirt_ssp_operator_up == 0"), | ||
For: ptr.To[promv1.Duration]("5m"), | ||
Annotations: map[string]string{ | ||
"summary": "All SSP operator pods are down.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "critical", | ||
healthImpactAlertLabelKey: "critical", | ||
}, | ||
}, | ||
{ | ||
Alert: "SSPTemplateValidatorDown", | ||
Expr: intstr.FromString("kubevirt_ssp_template_validator_up == 0"), | ||
For: ptr.To[promv1.Duration]("5m"), | ||
Annotations: map[string]string{ | ||
"summary": "All Template Validator pods are down.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "critical", | ||
healthImpactAlertLabelKey: "critical", | ||
}, | ||
}, | ||
{ | ||
Alert: "SSPFailingToReconcile", | ||
Expr: intstr.FromString("(kubevirt_ssp_operator_reconcile_succeeded_aggregated == 0) and (kubevirt_ssp_operator_up > 0)"), | ||
For: ptr.To[promv1.Duration]("5m"), | ||
Annotations: map[string]string{ | ||
"summary": "The ssp-operator pod is up but failing to reconcile.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "critical", | ||
healthImpactAlertLabelKey: "critical", | ||
}, | ||
}, | ||
{ | ||
Alert: "SSPHighRateRejectedVms", | ||
Expr: intstr.FromString("kubevirt_ssp_template_validator_rejected_increase > 5"), | ||
For: ptr.To[promv1.Duration]("5m"), | ||
Annotations: map[string]string{ | ||
"summary": "High rate of rejected Vms.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "warning", | ||
healthImpactAlertLabelKey: "warning", | ||
}, | ||
}, | ||
{ | ||
Alert: "SSPCommonTemplatesModificationReverted", | ||
Expr: intstr.FromString("kubevirt_ssp_common_templates_restored_increase > 0"), | ||
For: ptr.To[promv1.Duration]("0m"), | ||
Annotations: map[string]string{ | ||
"summary": "Common Templates manual modifications were reverted by the operator.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "warning", | ||
healthImpactAlertLabelKey: "none", | ||
}, | ||
}, | ||
{ | ||
Alert: "VMStorageClassWarning", | ||
Expr: intstr.FromString("(count(kubevirt_ssp_vm_rbd_block_volume_without_rxbounce > 0) or vector(0)) > 0"), | ||
Annotations: map[string]string{ | ||
"summary": "{{ $value }} Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns.", | ||
"description": "When running VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "warning", | ||
healthImpactAlertLabelKey: "none", | ||
}, | ||
}, | ||
} | ||
} |
Oops, something went wrong.