Update chronograf backend with OpsGenie2
parent
0d42cf8fc1
commit
a54e8c76bd
|
@ -21,6 +21,7 @@ type AlertNodes struct {
|
|||
HipChat []*HipChat `json:"hipChat"` // HipChat will send alert to all HipChat
|
||||
Alerta []*Alerta `json:"alerta"` // Alerta will send alert to all Alerta
|
||||
OpsGenie []*OpsGenie `json:"opsGenie"` // OpsGenie will send alert to all OpsGenie
|
||||
OpsGenie2 []*OpsGenie `json:"opsGenie2"` // OpsGenie2 will send alert to all OpsGenie v2
|
||||
Talk []*Talk `json:"talk"` // Talk will send alert to all Talk
|
||||
}
|
||||
|
||||
|
|
|
@ -429,6 +429,22 @@ func newAlertResponse(task *kapa.Task, srcID, kapaID int) *alertResponse {
|
|||
}
|
||||
}
|
||||
|
||||
if res.AlertNodes.OpsGenie2 == nil {
|
||||
res.AlertNodes.OpsGenie2 = []*chronograf.OpsGenie{}
|
||||
}
|
||||
|
||||
for i, a := range res.AlertNodes.OpsGenie2 {
|
||||
if a.Teams == nil {
|
||||
a.Teams = []string{}
|
||||
res.AlertNodes.OpsGenie2[i] = a
|
||||
}
|
||||
|
||||
if a.Recipients == nil {
|
||||
a.Recipients = []string{}
|
||||
res.AlertNodes.OpsGenie2[i] = a
|
||||
}
|
||||
}
|
||||
|
||||
if res.AlertNodes.PagerDuty == nil {
|
||||
res.AlertNodes.PagerDuty = []*chronograf.PagerDuty{}
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ func Test_KapacitorRulesGet(t *testing.T) {
|
|||
HipChat: []*chronograf.HipChat{},
|
||||
Alerta: []*chronograf.Alerta{},
|
||||
OpsGenie: []*chronograf.OpsGenie{},
|
||||
OpsGenie2: []*chronograf.OpsGenie{},
|
||||
Talk: []*chronograf.Talk{},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue