From d33c4e5e7c24e63fce7fc6c284ea15e5fbfaff72 Mon Sep 17 00:00:00 2001 From: Tomo Wang Date: Wed, 2 Dec 2020 18:09:49 +0800 Subject: [PATCH] Alarting: fix alarm messages in dingding (Fixes #29470) (#29482) --- pkg/services/alerting/notifiers/dingding.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/alerting/notifiers/dingding.go b/pkg/services/alerting/notifiers/dingding.go index 0070cfdacd7..cad82229253 100644 --- a/pkg/services/alerting/notifiers/dingding.go +++ b/pkg/services/alerting/notifiers/dingding.go @@ -119,14 +119,14 @@ func (dd *DingDingNotifier) genBody(evalContext *alerting.EvalContext, messageUR } for i, match := range evalContext.EvalMatches { - message += fmt.Sprintf("\\n%2d. %s: %s", i+1, match.Metric, match.Value) + message += fmt.Sprintf("\n%2d. %s: %s", i+1, match.Metric, match.Value) } var bodyMsg map[string]interface{} if dd.MsgType == "actionCard" { // Embed the pic into the markdown directly because actionCard doesn't have a picUrl field if dd.NeedsImage() && picURL != "" { - message = "![](" + picURL + ")\\n\\n" + message + message = "![](" + picURL + ")\n\n" + message } bodyMsg = map[string]interface{}{