Skip to content

Commit

Permalink
fix: pd unique key format (#78)
Browse files Browse the repository at this point in the history
* fix: pd unique key format

* fix: metamessage unique key
  • Loading branch information
mabdh authored Jul 24, 2024
1 parent b68c935 commit 92d58aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/notification/metamessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ type MetaMessage struct {
Template string
Labels map[string]string
MergedLabels map[string][]string
UniqueKey string
}
1 change: 1 addition & 0 deletions core/notification/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (n Notification) MetaMessage(receiverView subscription.ReceiverView) MetaMe
ValidDuration: n.ValidDuration,
Template: n.Template,
Labels: n.Labels,
UniqueKey: n.UniqueKey,
}

if receiverView.SubscriptionID != 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{{- end}}
{{- end}}
event_type: "{{template "pagerduty.event_type" . }}"
{{if .Data.id}}incident_key: "{{.UniqueKey}}"{{ end }}
incident_key: "{{.UniqueKey}}"
description: ({{ .Data.status | toUpper }}{{ if eq .Data.status "firing" }}:{{ .Data.num_alerts_firing }}{{ end }})
{{- if eq .Data.status "resolved" }} ~({{ .Data.severity | toUpper }})~
{{- else }} *({{ .Data.severity | toUpper }})*
Expand Down

0 comments on commit 92d58aa

Please sign in to comment.