mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-13 17:43:26 +00:00
Slack: Support image/thumb url in attachment (#1506)
This closes #1491 Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org>
This commit is contained in:
parent
f8b95a2e95
commit
f443038149
@ -305,6 +305,8 @@ 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"`
|
||||
ImageURL string `yaml:"image_url,omitempty" json:"image_url,omitempty"`
|
||||
ThumbURL string `yaml:"thumb_url,omitempty" json:"thumb_url,omitempty"`
|
||||
LinkNames bool `yaml:"link_names,omitempty" json:"link_names,omitempty"`
|
||||
Actions []*SlackAction `yaml:"actions,omitempty" json:"actions,omitempty"`
|
||||
}
|
||||
|
@ -667,6 +667,8 @@ type slackAttachment struct {
|
||||
Fallback string `json:"fallback"`
|
||||
Fields []config.SlackField `json:"fields,omitempty"`
|
||||
Actions []config.SlackAction `json:"actions,omitempty"`
|
||||
ImageURL string `json:"image_url,omitempty"`
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
Footer string `json:"footer"`
|
||||
|
||||
Color string `json:"color,omitempty"`
|
||||
@ -687,6 +689,8 @@ func (n *Slack) Notify(ctx context.Context, as ...*types.Alert) (bool, error) {
|
||||
Pretext: tmplText(n.conf.Pretext),
|
||||
Text: tmplText(n.conf.Text),
|
||||
Fallback: tmplText(n.conf.Fallback),
|
||||
ImageURL: tmplText(n.conf.ImageURL),
|
||||
ThumbURL: tmplText(n.conf.ThumbURL),
|
||||
Footer: tmplText(n.conf.Footer),
|
||||
Color: tmplText(n.conf.Color),
|
||||
MrkdwnIn: []string{"fallback", "pretext", "text"},
|
||||
|
Loading…
Reference in New Issue
Block a user