Skip to content

Commit

Permalink
Merge pull request #354 from livepeer/ENG-1634-fix
Browse files Browse the repository at this point in the history
[ENG-1634] PagerDuty Summary field to be trimmed to 1024 chars
  • Loading branch information
pwilczynskiclearcode committed Feb 8, 2024
2 parents deaa276 + fb3bc8c commit c62f64e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
done
- name: Upload artifacts for cutting release
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: releases/
Expand Down
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 c62f64e

Please sign in to comment.