浏览代码

feat(webhook): adds alert rule message to webhook

close #6807
bergquist 9 年之前
父节点
当前提交
9dd6cf45ac
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pkg/services/alerting/notifiers/webhook.go

+ 4 - 0
pkg/services/alerting/notifiers/webhook.go

@@ -58,6 +58,10 @@ func (this *WebhookNotifier) Notify(evalContext *alerting.EvalContext) error {
 		bodyJSON.Set("imageUrl", evalContext.ImagePublicUrl)
 	}
 
+	if evalContext.Rule.Message != "" {
+		bodyJSON.Set("message", evalContext.Rule.Message)
+	}
+
 	body, _ := bodyJSON.MarshalJSON()
 
 	cmd := &m.SendWebhookSync{