Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pagerduty): issue alert custom severity #67158

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

cathteng
Copy link
Member

@cathteng cathteng commented Mar 18, 2024

Allow setting custom severity for Pagerduty actions for issue alerts.
Screenshot 2024-03-18 at 10 10 30

Essentially copies the Opsgenie implementation of custom issue alert priorities #56140

Default severity utilizes the existing LEVEL_SEVERITY_MAP:

LEVEL_SEVERITY_MAP = {
"debug": "info",
"info": "info",
"warning": "warning",
"error": "error",
"fatal": "critical",
}

For #54921

@cathteng cathteng requested a review from vartec March 18, 2024 17:16
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 18, 2024
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.32%. Comparing base (1344f8d) to head (d0b3819).
Report is 22 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #67158   +/-   ##
=======================================
  Coverage   84.31%   84.32%           
=======================================
  Files        5306     5306           
  Lines      237081   237122   +41     
  Branches    41001    41010    +9     
=======================================
+ Hits       199906   199952   +46     
+ Misses      36957    36952    -5     
  Partials      218      218           
Files Coverage Δ
...try/integrations/pagerduty/actions/notification.py 86.30% <100.00%> (+1.68%) ⬆️
src/sentry/integrations/pagerduty/client.py 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

src/sentry/integrations/pagerduty/actions/notification.py Outdated Show resolved Hide resolved
@@ -14,6 +14,8 @@
"error": "error",
"fatal": "critical",
}
PAGERDUTY_DEFAULT_PRIORITY = "default" # represents using LEVEL_SEVERITY_MAP
PagerdutyPriority = Literal["default", "critical", "warning", "error", "info"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not make it an StrEnum?

Co-authored-by: Bartek Ogryczak <bartek.ogryczak@sentry.io>
@cathteng cathteng marked this pull request as ready for review March 18, 2024 21:54
@cathteng cathteng requested a review from a team as a code owner March 18, 2024 21:54
@cathteng cathteng merged commit e4ac25c into master Mar 19, 2024
50 checks passed
@cathteng cathteng deleted the cathy/pagerduty/issue-alert-custom-severity branch March 19, 2024 14:58
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants