Skip to content
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
3 changes: 2 additions & 1 deletion controllers/argocd_metrics_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ func newPrometheusRule(namespace string) *monitoringv1.PrometheusRule {
{
Alert: "ArgoCDSyncAlert",
Annotations: map[string]string{
"message": "ArgoCD application {{ $labels.name }} is out of sync",
"summary": "Argo CD application is out of sync",
"description": "Argo CD application {{ $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.",
},
Expr: intstr.IntOrString{
Type: intstr.String,
Expand Down
3 changes: 2 additions & 1 deletion controllers/argocd_metrics_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ func TestReconciler_add_prometheus_rule(t *testing.T) {
assert.Equal(t, rule.OwnerReferences[0].Name, tc.instanceName)

assert.Equal(t, rule.Spec.Groups[0].Rules[0].Alert, "ArgoCDSyncAlert")
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["message"] != "")
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["summary"] != "")
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["description"] != "")
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Labels["severity"] != "")
assert.Equal(t, rule.Spec.Groups[0].Rules[0].For, "5m")
expr := fmt.Sprintf("argocd_app_info{namespace=\"%s\",sync_status=\"OutOfSync\"} > 0", tc.namespace)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ spec:
rules:
- alert: ArgoCDSyncAlert
annotations:
message: ArgoCD application {{ $labels.name }} is out of sync
summary: Argo CD application is out of sync
description: Argo CD application {{ $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.
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
labels:
severity: warning
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spec:
rules:
- alert: ArgoCDSyncAlert
annotations:
message: ArgoCD application {{ $labels.name }} is out of sync
summary: Argo CD application is out of sync
description: Argo CD application {{ $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.
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
for: 5m
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ spec:
rules:
- alert: ArgoCDSyncAlert
annotations:
message: ArgoCD application {{ $labels.name }} is out of sync
summary: Argo CD application is out of sync
description: Argo CD application {{ $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.
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
for: 5m
labels:
severity: warning
severity: warning
Loading