From fd0ace8d88ad5ae8a9ddd77a50f2df73e084107e Mon Sep 17 00:00:00 2001 From: Tom Fawcett Date: Sun, 12 Nov 2017 17:01:19 +0000 Subject: [PATCH] Support OpsGenie Priority field (#1094) --- config/notifiers.go | 1 + notify/impl.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config/notifiers.go b/config/notifiers.go index fce20a43..5193100d 100644 --- a/config/notifiers.go +++ b/config/notifiers.go @@ -308,6 +308,7 @@ type OpsGenieConfig struct { Teams string `yaml:"teams,omitempty" json:"teams,omitempty"` Tags string `yaml:"tags,omitempty" json:"tags,omitempty"` Note string `yaml:"note,omitempty" json:"note,omitempty"` + Priority string `yaml:"priority,omitempty" json:"priority,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 5144a09f..b47244f2 100644 --- a/notify/impl.go +++ b/notify/impl.go @@ -792,6 +792,7 @@ type opsGenieCreateMessage struct { Teams string `json:"teams,omitempty"` Tags string `json:"tags,omitempty"` Note string `json:"note,omitempty"` + Priority string `json:"priority,omitempty"` } type opsGenieCloseMessage struct { @@ -843,6 +844,7 @@ func (n *OpsGenie) Notify(ctx context.Context, as ...*types.Alert) (bool, error) Teams: tmpl(n.conf.Teams), Tags: tmpl(n.conf.Tags), Note: tmpl(n.conf.Note), + Priority: tmpl(n.conf.Priority), } } if err != nil {