diff --git a/config/notifiers.go b/config/notifiers.go index 6ba67234..24ec7c8f 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -218,6 +218,7 @@ type SlackConfig struct { Fallback string `yaml:"fallback,omitempty" json:"fallback,omitempty"` IconEmoji string `yaml:"icon_emoji,omitempty" json:"icon_emoji,omitempty"` IconURL string `yaml:"icon_url,omitempty" json:"icon_url,omitempty"` + LinkNames bool `yaml:"link_names,omitempty" json:"link_names,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` diff --git a/notify/impl.go b/notify/impl.go index 827e5a49..f2283e60 100644 --- a/notify/impl.go +++ b/notify/impl.go @@ -498,6 +498,7 @@ type slackReq struct { Username string `json:"username,omitempty"` IconEmoji string `json:"icon_emoji,omitempty"` IconURL string `json:"icon_url,omitempty"` + LinkNames bool `json:"link_names,omitempty"` Attachments []slackAttachment `json:"attachments"` } @@ -542,6 +543,7 @@ func (n *Slack) Notify(ctx context.Context, as ...*types.Alert) (bool, error) { Username: tmplText(n.conf.Username), IconEmoji: tmplText(n.conf.IconEmoji), IconURL: tmplText(n.conf.IconURL), + LinkNames: n.conf.LinkNames, Attachments: []slackAttachment{*attachment}, } if err != nil {