Skip to content

Commit e175225

Browse files
authored
fix(monitor): alerting level (#23802)
1 parent 3fccc13 commit e175225

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/monitor/alerting/notifiers/onecloud.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ func generateMonitorTitle(suffix string, data interface{}) string {
6464
var level string
6565
if suffix == "cn" {
6666
level = "普通"
67-
if priority == "important" {
67+
if priority == string(notify.NotifyPriorityImportant) {
6868
level = "重要"
69-
} else if priority == "critical" {
69+
} else if priority == string(notify.NotifyPriorityCritical) {
7070
level = "致命"
7171
}
7272
} else {
7373
level = "Normal"
74-
if priority == "important" {
74+
if priority == string(notify.NotifyPriorityImportant) {
7575
level = "Important"
76-
} else if priority == "critical" {
76+
} else if priority == string(notify.NotifyPriorityCritical) {
7777
level = "Critical"
7878
}
7979
}
@@ -219,10 +219,10 @@ func getNotifyTemplateConfigOfLang(ctx *alerting.EvalContext,
219219
priority = notify.NotifyPriorityNormal
220220
case "important":
221221
priority = notify.NotifyPriorityImportant
222-
level = levelNormal
222+
level = levelImportant
223223
case "fatal", "critical":
224224
priority = notify.NotifyPriorityCritical
225-
level = levelNormal
225+
level = levelCritial
226226
}
227227
topic := fmt.Sprintf("[%s]", trans(level))
228228

0 commit comments

Comments
 (0)