You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
1. workload replicate persent can't show in alert info
2. cluster/project id not easy to identify in alert info
Solution:
1. update alert notify template
2. use cluster/project display name instead of id
Issue:
rancher#18156rancher#18160
Copy file name to clipboardExpand all lines: pkg/controllers/user/alert/deployer/notification_template.go
+8-11Lines changed: 8 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,10 @@ The Pod {{ if .GroupLabels.namespace}}{{.GroupLabels.namespace}}:{{end}}{{.Group
25
25
The Pod {{ if .GroupLabels.namespace}}{{.GroupLabels.namespace}}:{{end}}{{.GroupLabels.pod_name}} is not running
26
26
27
27
{{- else if eq .CommonLabels.alert_type "podRestarts" }}
28
-
The Pod {{ if .GroupLabels.namespace}}{{.GroupLabels.namespace}}:{{end}}{{.GroupLabels.pod_name}} restarts {{ .GroupLabels.restart_times}} times in {{ .GroupLabels.restart_interval}} sec
28
+
The Pod {{ if .GroupLabels.namespace}}{{.GroupLabels.namespace}}:{{end}}{{.GroupLabels.pod_name}} restarts {{ .CommonLabels.restart_times}} times in {{ .CommonLabels.restart_interval}} sec
29
29
30
30
{{- else if eq .CommonLabels.alert_type "workload" }}
31
-
The workload {{ if .GroupLabels.workload_namespace}}{{.GroupLabels.workload_namespace}}:{{end}}{{.GroupLabels.workload_name}} has available replicas less than {{ .GroupLabels.available_percentage}}%
31
+
The workload {{ if .GroupLabels.workload_namespace}}{{.GroupLabels.workload_namespace}}:{{end}}{{.GroupLabels.workload_name}} has available replicas less than {{ .CommonLabels.available_percentage}}%
32
32
33
33
{{- else if eq .CommonLabels.alert_type "metric" }}
34
34
The metric {{ .CommonLabels.alert_name}} crossed the threshold
Available Replicas: {{ .Labels.available_replicas}}
100
100
Desired Replicas: {{ .Labels.desired_replicas}}
101
101
{{- else if eq .Labels.alert_type "metric" }}
102
-
{{ if .Labels.project_name }}
103
-
Project Name: {{ .Labels.project_name}}
104
-
{{ end -}}
105
-
{{ if .Labels.pod_name }}
106
-
Pod Name: {{ .Labels.pod_name}}{{ else if .Labels.pod -}}Pod Name: {{ .Labels.pod}}
107
-
{{ end -}}
108
-
{{ if .Labels.namespace }}
109
-
Namespace: {{ .Labels.namespace}}
110
-
{{ end -}}
102
+
{{- if .Labels.namespace }}
103
+
Namespace: {{ .Labels.namespace}}{{ end }}
104
+
{{- if .Labels.project_name }}
105
+
Project Name: {{ .Labels.project_name}}{{ end }}
106
+
{{- if .Labels.pod_name }}
107
+
Pod Name: {{ .Labels.pod_name}}{{ else if .Labels.pod -}}Pod Name: {{ .Labels.pod}}{{ end }}
111
108
Expression: {{ .Labels.expression}}
112
109
Description: Threshold Crossed: datapoint value {{ .Annotations.current_value}} was {{ .Labels.comparison}} to the threshold ({{ .Labels.threshold_value}}) for ({{ .Labels.duration}})
0 commit comments