-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OperatorConditionsUnhealthy alerts (#3144)
* Add reason label to kubevirt_hco_system_health_status Signed-off-by: João Vilaça <[email protected]> * Add OperatorConditionsUnhealthy alerts Signed-off-by: João Vilaça <[email protected]> * Fix GetHCOMetric Signed-off-by: João Vilaça <[email protected]> --------- Signed-off-by: João Vilaça <[email protected]>
- Loading branch information
1 parent
04327e1
commit 726acfe
Showing
7 changed files
with
126 additions
and
25 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
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,35 @@ | ||
package alerts | ||
|
||
import ( | ||
promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" | ||
"k8s.io/apimachinery/pkg/util/intstr" | ||
) | ||
|
||
func healthAlerts() []promv1.Rule { | ||
return []promv1.Rule{ | ||
{ | ||
Alert: "OperatorConditionsUnhealthy", | ||
Expr: intstr.FromString("kubevirt_hco_system_health_status == 2"), | ||
Annotations: map[string]string{ | ||
"description": "HCO and its secondary resources are in a critical state due to {{ $labels.reason }}.", | ||
"summary": "HCO and its secondary resources are in a critical state.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "critical", | ||
healthImpactAlertLabelKey: "critical", | ||
}, | ||
}, | ||
{ | ||
Alert: "OperatorConditionsUnhealthy", | ||
Expr: intstr.FromString("kubevirt_hco_system_health_status == 1"), | ||
Annotations: map[string]string{ | ||
"description": "HCO and its secondary resources are in a warning state due to {{ $labels.reason }}.", | ||
"summary": "HCO and its secondary resources are in a warning state.", | ||
}, | ||
Labels: map[string]string{ | ||
severityAlertLabelKey: "warning", | ||
healthImpactAlertLabelKey: "warning", | ||
}, | ||
}, | ||
} | ||
} |
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