Skip to content

Commit bc89c98

Browse files
committed
Add additional alerting rule for Unknown Sync State
1 parent e602965 commit bc89c98

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

controllers/argocd_metrics_controller.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,10 @@ func newPrometheusRule(namespace string) *monitoringv1.PrometheusRule {
592592
Name: "GitOpsOperatorArgoCD",
593593
Rules: []monitoringv1.Rule{
594594
{
595-
Alert: "ArgoCDSyncAlert",
595+
Alert: "ArgoCDOutOfSyncAlert",
596596
Annotations: map[string]string{
597597
"summary": "Argo CD application is out of sync",
598-
"description": "Argo CD application {{ $labels.namespace }}/{{ $labels.name }} is out of sync. Check ArgoCDSyncAlert status, this alert is designed to notify that an application managed by Argo CD is out of sync.",
598+
"description": "Argo CD application {{ $labels.namespace }}/{{ $labels.name }} is out of sync. Check ArgoCDOutOfSyncAlert status, this alert is designed to notify that an application managed by Argo CD is out of sync.",
599599
},
600600
Expr: intstr.IntOrString{
601601
Type: intstr.String,
@@ -611,6 +611,21 @@ func newPrometheusRule(namespace string) *monitoringv1.PrometheusRule {
611611
"severity": "warning",
612612
},
613613
},
614+
{
615+
Alert: "ArgoCDUnknownSyncAlert",
616+
Annotations: map[string]string{
617+
"summary": "Argo CD application sync state is unknown",
618+
"description": "Argo CD application {{ $labels.namespace }}/{{ $labels.name }} is in an unknown sync state. Check ArgoCDUnknownSyncAlert status, this often occurs when the Application is misconfigured.",
619+
},
620+
Expr: intstr.IntOrString{
621+
Type: intstr.String,
622+
StrVal: fmt.Sprintf("argocd_app_info{namespace=\"%s\",sync_status=\"Unknown\"} > 0", namespace),
623+
},
624+
For: "5m",
625+
Labels: map[string]string{
626+
"severity": "critical",
627+
},
628+
},
614629
{
615630
Alert: "ArgoCDHealthAlert",
616631
Annotations: map[string]string{

0 commit comments

Comments
 (0)