mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-27 08:32:15 +00:00
Add support for Teams and Tags to OpsGenie notifier
Add Teams and Tags templated strings to OpsGenieConfig. Output must be comma-separated values.
This commit is contained in:
parent
04fbfb9a65
commit
7d512eba56
@ -280,6 +280,8 @@ type OpsGenieConfig struct {
|
||||
Description string `yaml:"description"`
|
||||
Source string `yaml:"source"`
|
||||
Details map[string]string `yaml:"details"`
|
||||
Teams string `yaml:"teams"`
|
||||
Tags string `yaml:"tags"`
|
||||
|
||||
// Catches all undefined fields and must be empty after parsing.
|
||||
XXX map[string]interface{} `yaml:",inline"`
|
||||
|
@ -620,6 +620,8 @@ type opsGenieCreateMessage struct {
|
||||
Message string `json:"message"`
|
||||
Details map[string]string `json:"details"`
|
||||
Source string `json:"source"`
|
||||
Teams string `json:"teams,omitempty"`
|
||||
Tags string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
type opsGenieCloseMessage struct {
|
||||
@ -665,6 +667,8 @@ func (n *OpsGenie) Notify(ctx context.Context, as ...*types.Alert) error {
|
||||
Message: tmpl(n.conf.Description),
|
||||
Details: details,
|
||||
Source: tmpl(n.conf.Source),
|
||||
Teams: tmpl(n.conf.Teams),
|
||||
Tags: tmpl(n.conf.Tags),
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user