Skip to content

Commit

Permalink
record-tester: Use different dedup key when lopri
Browse files Browse the repository at this point in the history
Otherwise it could get confusing that the incident with
the [LOPRI] prefix sends a high urgency alert.
  • Loading branch information
victorges committed Dec 20, 2021
1 parent 7febd3e commit dd18e9f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/app/recordtester/continuous_record_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,15 @@ func (crt *continuousRecordTester) sendPagerdutyEvent(rt IRecordTester, err erro
if crt.pagerDutyIntegrationKey == "" {
return
}
severity, lopriPrefix, dedupKey := "error", "", fmt.Sprintf("cont-record-tester:%s", crt.host)
if crt.pagerDutyLowUrgency {
severity, lopriPrefix = "warning", "[LOPRI] "
dedupKey = "lopri-" + dedupKey
}
event := pagerduty.V2Event{
RoutingKey: crt.pagerDutyIntegrationKey,
Action: "trigger",
DedupKey: fmt.Sprintf("cont-record-tester:%s", crt.host),
DedupKey: dedupKey,
}
if err == nil {
event.Action = "resolve"
Expand All @@ -139,10 +144,6 @@ func (crt *continuousRecordTester) sendPagerdutyEvent(rt IRecordTester, err erro
}
return
}
severity, lopriPrefix := "error", ""
if crt.pagerDutyLowUrgency {
severity, lopriPrefix = "warning", "[LOPRI] "
}
event.Payload = &pagerduty.V2Payload{
Source: crt.host,
Component: crt.pagerDutyComponent,
Expand Down

0 comments on commit dd18e9f

Please sign in to comment.