Skip to content

Commit

Permalink
[ENG-1634] PagerDuty Summary field to be trimmed to 1023 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
pwilczynskiclearcode committed Feb 7, 2024
1 parent deaa276 commit 46a6a35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/app/recordtester/continuous_record_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ func (crt *continuousRecordTester) sendPagerdutyEvent(rt IRecordTester, err erro
}
return
}

summary := fmt.Sprintf("%s%s %s for `%s` error: %v", lopriPrefix, componentName, crt.pagerDutyComponent, crt.host, err)
if len(summary) > 1024 {
summary = summary[:1024] // summary can be 1024 chars max
}

event.Payload = &pagerduty.V2Payload{
Source: crt.host,
Component: crt.pagerDutyComponent,
Severity: severity,
Summary: fmt.Sprintf("%s%s %s for `%s` error: %v", lopriPrefix, componentName, crt.pagerDutyComponent, crt.host, err),
Summary: summary,
Timestamp: time.Now().UTC().Format(time.RFC3339),
}
sid := rt.StreamID()
Expand Down

0 comments on commit 46a6a35

Please sign in to comment.