-
Notifications
You must be signed in to change notification settings - Fork 4
Reorganize incident creation / issue occurrence logic #8
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
base: monitor-incident-refactor-before
Are you sure you want to change the base?
Reorganize incident creation / issue occurrence logic #8
Conversation
…0528) Since we'll be doing more with issue occurrences split out the concept of incidents into it's own logic module, as well as incident_occurrence into it's own module Part of GH-80527
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
PR #8
PR Type
Enhancement
Description
Extract incident creation logic into dedicated
incidents.pymoduleExtract incident occurrence logic into dedicated
incident_occurrence.pymoduleMove
SimpleCheckIntype definition totypes.pyfor reusabilitySimplify
mark_failed.pyby delegating to newtry_incident_thresholdfunctionDiagram Walkthrough
File Walkthrough
incident_occurrence.py
New incident occurrence creation logic modulesrc/sentry/monitors/logic/incident_occurrence.py
create_incident_occurrence()function to produce Kafkaevents
get_failure_reason()andget_monitor_environment_context()incidents.py
New incident threshold and creation logic modulesrc/sentry/monitors/logic/incidents.py
try_incident_threshold()function to handle incident statetransitions
create_incident_occurrence()for event productionmark_failed.py
Refactor to delegate incident logic to new modulessrc/sentry/monitors/logic/mark_failed.py
SimpleCheckInTypedDict definitionget_failure_reason(),get_monitor_environment_context()try_incident_threshold()function
types.py
Add SimpleCheckIn type definition for reusesrc/sentry/monitors/types.py
SimpleCheckInTypedDict definition with fields:id,date_added,status