Skip to content

Commit

Permalink
CLD-8257 Add support for Ring name in Elrond notifications (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Stylianos Rigas <[email protected]>
  • Loading branch information
stylianosrigas and Stylianos Rigas authored Sep 11, 2024
1 parent fae6e85 commit b327574
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elrond-notification/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func handleRingWebhook(payload *elrond.WebhookPayload) error {
}

attach = *attach.AddField(mmField{Title: "Ring ID", Value: payload.ID, Short: true})
attach = *attach.AddField(mmField{Title: "Ring Name", Value: payload.Name, Short: true})
attach = *attach.AddField(mmField{Title: "Type", Value: payload.Type, Short: true})
attach = *attach.AddField(mmField{Title: "New State", Value: payload.NewState, Short: true})
attach = *attach.AddField(mmField{Title: "Old State", Value: payload.OldState, Short: true})
Expand Down Expand Up @@ -206,7 +207,7 @@ func sendPagerDutyNotification(payload *elrond.WebhookPayload) error {

tm := time.Unix(0, payload.Timestamp)
alertReq := &pagerduty.V2Payload{
Summary: fmt.Sprintf("%s - %s %s", payload.Type, payload.ID, payload.NewState),
Summary: fmt.Sprintf("%s - %s - %s %s", payload.Type, payload.ID, payload.Name, payload.NewState),
Source: "Alarm System",
Severity: "critical",
Details: map[string]string{
Expand Down

0 comments on commit b327574

Please sign in to comment.