Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion senders/pagerduty/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (sender *Sender) SendEvents(events moira.NotificationEvents, contact moira.
if err != nil {
return fmt.Errorf("failed to post the event to the pagerduty contact %s : %s. ", contact.Value, err)
}

return nil
}

Expand Down Expand Up @@ -61,10 +62,16 @@ func (sender *Sender) buildEvent(events moira.NotificationEvents, contact moira.
Details: details,
}

lAction := "trigger"
if events.GetSubjectState() == moira.StateOK {
lAction = "resolve"
}

event := pagerduty.V2Event{
RoutingKey: contact.Value,
Action: "trigger",
Action: lAction,
Payload: payload,
DedupKey: trigger.ID,
}

if len(plot) > 0 && sender.imageStoreConfigured {
Expand Down