diff --git a/docs/sources/alerting/notifications.md b/docs/sources/alerting/notifications.md index 06158768870..7ec53e402b1 100644 --- a/docs/sources/alerting/notifications.md +++ b/docs/sources/alerting/notifications.md @@ -186,7 +186,7 @@ Slack | `slack` | yes | no Telegram | `telegram` | yes | no Threema | `threema` | yes, external only | no VictorOps | `victorops` | yes, external only | no -Webhook | `webhook` | yes, external only | no +Webhook | `webhook` | yes, external only | yes # Enable images in notifications {#external-image-store} diff --git a/pkg/services/alerting/notifiers/webhook.go b/pkg/services/alerting/notifiers/webhook.go index f5ee9924512..2e907d5e912 100644 --- a/pkg/services/alerting/notifiers/webhook.go +++ b/pkg/services/alerting/notifiers/webhook.go @@ -81,6 +81,14 @@ func (wn *WebhookNotifier) Notify(evalContext *alerting.EvalContext) error { bodyJSON.Set("state", evalContext.Rule.State) bodyJSON.Set("evalMatches", evalContext.EvalMatches) + tags := make(map[string]string) + + for _, tag := range evalContext.Rule.AlertRuleTags { + tags[tag.Key] = tag.Value + } + + bodyJSON.Set("tags", tags) + ruleURL, err := evalContext.GetRuleURL() if err == nil { bodyJSON.Set("ruleUrl", ruleURL)