From eb23d862c1c76f23b314bf8d325e9b9ade42b0af Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Fri, 21 Nov 2025 10:27:00 +0800 Subject: [PATCH] fix(monitor): alerting level (#23801) --- pkg/monitor/alerting/notifiers/onecloud.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/monitor/alerting/notifiers/onecloud.go b/pkg/monitor/alerting/notifiers/onecloud.go index bc3c92e850..8176a7e308 100644 --- a/pkg/monitor/alerting/notifiers/onecloud.go +++ b/pkg/monitor/alerting/notifiers/onecloud.go @@ -64,16 +64,16 @@ func generateMonitorTitle(suffix string, data interface{}) string { var level string if suffix == "cn" { level = "普通" - if priority == "important" { + if priority == string(notify.NotifyPriorityImportant) { level = "重要" - } else if priority == "critical" { + } else if priority == string(notify.NotifyPriorityCritical) { level = "致命" } } else { level = "Normal" - if priority == "important" { + if priority == string(notify.NotifyPriorityImportant) { level = "Important" - } else if priority == "critical" { + } else if priority == string(notify.NotifyPriorityCritical) { level = "Critical" } } @@ -219,10 +219,10 @@ func getNotifyTemplateConfigOfLang(ctx *alerting.EvalContext, priority = notify.NotifyPriorityNormal case "important": priority = notify.NotifyPriorityImportant - level = levelNormal + level = levelImportant case "fatal", "critical": priority = notify.NotifyPriorityCritical - level = levelNormal + level = levelCritial } topic := fmt.Sprintf("[%s]", trans(level))