Skip to content

Commit 9399549

Browse files
authored
Add description label to ArgoCDSyncAlert (#704)
* Add description label to ArgoCDSyncAlert Signed-off-by: Rizwana777 <[email protected]> * Move description to annotations and add summary Signed-off-by: Rizwana777 <[email protected]> --------- Signed-off-by: Rizwana777 <[email protected]>
1 parent db3c6bd commit 9399549

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

controllers/argocd_metrics_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,8 @@ func newPrometheusRule(namespace string) *monitoringv1.PrometheusRule {
521521
{
522522
Alert: "ArgoCDSyncAlert",
523523
Annotations: map[string]string{
524-
"message": "ArgoCD application {{ $labels.name }} is out of sync",
524+
"summary": "Argo CD application is out of sync",
525+
"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.",
525526
},
526527
Expr: intstr.IntOrString{
527528
Type: intstr.String,

controllers/argocd_metrics_controller_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@ func TestReconciler_add_prometheus_rule(t *testing.T) {
283283
assert.Equal(t, rule.OwnerReferences[0].Name, tc.instanceName)
284284

285285
assert.Equal(t, rule.Spec.Groups[0].Rules[0].Alert, "ArgoCDSyncAlert")
286-
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["message"] != "")
286+
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["summary"] != "")
287+
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Annotations["description"] != "")
287288
assert.Assert(t, rule.Spec.Groups[0].Rules[0].Labels["severity"] != "")
288289
assert.Equal(t, rule.Spec.Groups[0].Rules[0].For, "5m")
289290
expr := fmt.Sprintf("argocd_app_info{namespace=\"%s\",sync_status=\"OutOfSync\"} > 0", tc.namespace)

test/openshift/e2e/ignore-tests/sequential/1-005_validate_metrics/01-assert.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ spec:
4646
rules:
4747
- alert: ArgoCDSyncAlert
4848
annotations:
49-
message: ArgoCD application {{ $labels.name }} is out of sync
49+
summary: Argo CD application is out of sync
50+
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.
5051
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
5152
labels:
5253
severity: warning

test/openshift/e2e/ignore-tests/sequential/1-041_validate_argocd_sync_alert/01-assert.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ spec:
1717
rules:
1818
- alert: ArgoCDSyncAlert
1919
annotations:
20-
message: ArgoCD application {{ $labels.name }} is out of sync
20+
summary: Argo CD application is out of sync
21+
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.
2122
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
2223
for: 5m
2324
labels:

test/openshift/e2e/sequential/1-041_validate_argocd_sync_alert/01-assert.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ spec:
1717
rules:
1818
- alert: ArgoCDSyncAlert
1919
annotations:
20-
message: ArgoCD application {{ $labels.name }} is out of sync
20+
summary: Argo CD application is out of sync
21+
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.
2122
expr: argocd_app_info{namespace="openshift-gitops",sync_status="OutOfSync"} > 0
2223
for: 5m
2324
labels:
24-
severity: warning
25+
severity: warning

0 commit comments

Comments
 (0)