Skip to content

ref(issue-taxonomy): Add new category mapping to GroupType definitions #90099

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

Merged
merged 3 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/grouping/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ErrorGroupType(GroupType):
slug = "error"
description = "Error"
category = GroupCategory.ERROR.value
category_v2 = GroupCategory.ERROR.value
default_priority = PriorityLevel.MEDIUM
released = True
detector_settings = DetectorSettings(
Expand Down
1 change: 1 addition & 0 deletions src/sentry/incidents/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class MetricAlertFire(GroupType):
slug = "metric_alert_fire"
description = "Metric alert fired"
category = GroupCategory.METRIC_ALERT.value
category_v2 = GroupCategory.PERFORMANCE_REGRESSION.value
creation_quota = Quota(3600, 60, 100)
default_priority = PriorityLevel.HIGH
enable_auto_resolve = False
Expand Down
60 changes: 60 additions & 0 deletions src/sentry/issues/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,41 @@

class GroupCategory(IntEnum):
ERROR = 1
"""
Deprecated
Will be broken out into PERFORMANCE_REGRESSION, PERFORMANCE_BEST_PRACTICE, and RESPONSIVENESS
"""
PERFORMANCE = 2
PROFILE = 3 # deprecated, merging with PERFORMANCE
"""
Deprecated
Cron types will move to the OUTAGE category
"""
CRON = 4
"""
Deprecated
Replay types will move to the USER_EXPERIENCE category
"""
REPLAY = 5
FEEDBACK = 6
"""
Deprecated
Uptime types will move to the OUTAGE category
"""
UPTIME = 7
"""
Deprecated
Metric alert types will move to the PERFORMANCE_REGRESSION category
"""
METRIC_ALERT = 8

# New issue categories (under the organizations:issue-taxonomy flag)
OUTAGE = 9
PERFORMANCE_REGRESSION = 10
USER_EXPERIENCE = 11
RESPONSIVENESS = 12
PERFORMANCE_BEST_PRACTICE = 13


GROUP_CATEGORIES_CUSTOM_EMAIL = (
GroupCategory.ERROR,
Expand All @@ -60,6 +87,7 @@ class GroupTypeRegistry:
_registry: dict[int, type[GroupType]] = field(default_factory=dict)
_slug_lookup: dict[str, type[GroupType]] = field(default_factory=dict)
_category_lookup: dict[int, set[int]] = field(default_factory=lambda: defaultdict(set))
_category_lookup_v2: dict[int, set[int]] = field(default_factory=lambda: defaultdict(set))

def add(self, group_type: type[GroupType]) -> None:
if self._registry.get(group_type.type_id):
Expand All @@ -69,6 +97,7 @@ def add(self, group_type: type[GroupType]) -> None:
self._registry[group_type.type_id] = group_type
self._slug_lookup[group_type.slug] = group_type
self._category_lookup[group_type.category].add(group_type.type_id)
self._category_lookup_v2[group_type.category_v2].add(group_type.type_id)

def all(self) -> list[type[GroupType]]:
return list(self._registry.values())
Expand Down Expand Up @@ -105,6 +134,9 @@ def get_all_group_type_ids(self) -> set[int]:
def get_by_category(self, category: int) -> set[int]:
return self._category_lookup[category]

def get_by_category_v2(self, category: int) -> set[int]:
return self._category_lookup_v2[category]

def get_by_slug(self, slug: str) -> type[GroupType] | None:
if slug not in self._slug_lookup:
return None
Expand Down Expand Up @@ -160,6 +192,9 @@ class GroupType:
slug: str
description: str
category: int
# New issue category mapping (under the organizations:issue-taxonomy flag)
# When GA'd, the original `category` will be removed and this will be renamed to `category`.
category_v2: int
noise_config: NoiseConfig | None = None
default_priority: int = PriorityLevel.MEDIUM
# If True this group type should be released everywhere. If False, fall back to features to
Expand Down Expand Up @@ -271,6 +306,7 @@ class PerformanceSlowDBQueryGroupType(PerformanceGroupTypeDefaults, GroupType):
slug = "performance_slow_db_query"
description = "Slow DB Query"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
noise_config = NoiseConfig(ignore_limit=100)
default_priority = PriorityLevel.LOW
released = True
Expand All @@ -282,6 +318,7 @@ class PerformanceRenderBlockingAssetSpanGroupType(PerformanceGroupTypeDefaults,
slug = "performance_render_blocking_asset_span"
description = "Large Render Blocking Asset"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True
use_flagpole_for_all_features = True
Expand All @@ -293,6 +330,7 @@ class PerformanceNPlusOneGroupType(PerformanceGroupTypeDefaults, GroupType):
slug = "performance_n_plus_one_db_queries"
description = "N+1 Query"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -303,6 +341,7 @@ class PerformanceConsecutiveDBQueriesGroupType(PerformanceGroupTypeDefaults, Gro
slug = "performance_consecutive_db_queries"
description = "Consecutive DB Queries"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
noise_config = NoiseConfig(ignore_limit=15)
default_priority = PriorityLevel.LOW
released = True
Expand All @@ -314,6 +353,7 @@ class PerformanceFileIOMainThreadGroupType(PerformanceGroupTypeDefaults, GroupTy
slug = "performance_file_io_main_thread"
description = "File IO on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -324,6 +364,7 @@ class PerformanceConsecutiveHTTPQueriesGroupType(PerformanceGroupTypeDefaults, G
slug = "performance_consecutive_http"
description = "Consecutive HTTP"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
noise_config = NoiseConfig(ignore_limit=5)
default_priority = PriorityLevel.LOW
released = True
Expand All @@ -335,6 +376,7 @@ class PerformanceNPlusOneAPICallsGroupType(GroupType):
slug = "performance_n_plus_one_api_calls"
description = "N+1 API Call"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -345,6 +387,7 @@ class PerformanceMNPlusOneDBQueriesGroupType(PerformanceGroupTypeDefaults, Group
slug = "performance_m_n_plus_one_db_queries"
description = "MN+1 Query"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -355,6 +398,7 @@ class PerformanceUncompressedAssetsGroupType(PerformanceGroupTypeDefaults, Group
slug = "performance_uncompressed_assets"
description = "Uncompressed Asset"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
noise_config = NoiseConfig(ignore_limit=100)
default_priority = PriorityLevel.LOW
released = True
Expand All @@ -366,6 +410,7 @@ class PerformanceDBMainThreadGroupType(PerformanceGroupTypeDefaults, GroupType):
slug = "performance_db_main_thread"
description = "DB on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -376,6 +421,7 @@ class PerformanceLargeHTTPPayloadGroupType(PerformanceGroupTypeDefaults, GroupTy
slug = "performance_large_http_payload"
description = "Large HTTP payload"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -387,6 +433,7 @@ class PerformanceHTTPOverheadGroupType(PerformanceGroupTypeDefaults, GroupType):
description = "HTTP/1.1 Overhead"
noise_config = NoiseConfig(ignore_limit=20)
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -397,6 +444,7 @@ class PerformanceP95EndpointRegressionGroupType(GroupType):
slug = "performance_p95_endpoint_regression"
description = "Endpoint Regression"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_REGRESSION.value
enable_auto_resolve = False
enable_escalation_detection = False
default_priority = PriorityLevel.MEDIUM
Expand All @@ -411,6 +459,7 @@ class PerformanceStreamedSpansGroupTypeExperimental(GroupType):
slug = "performance_streamed_spans_exp"
description = "Streamed Spans (Experimental)"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
enable_auto_resolve = False
enable_escalation_detection = False
default_priority = PriorityLevel.LOW
Expand All @@ -423,6 +472,7 @@ class ProfileFileIOGroupType(GroupType):
slug = "profile_file_io_main_thread"
description = "File I/O on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -433,6 +483,7 @@ class ProfileImageDecodeGroupType(GroupType):
slug = "profile_image_decode_main_thread"
description = "Image Decoding on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -443,6 +494,7 @@ class ProfileJSONDecodeType(GroupType):
slug = "profile_json_decode_main_thread"
description = "JSON Decoding on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
default_priority = PriorityLevel.LOW
released = True

Expand All @@ -453,6 +505,7 @@ class ProfileRegexType(GroupType):
slug = "profile_regex_main_thread"
description = "Regex on Main Thread"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
released = True
default_priority = PriorityLevel.LOW

Expand All @@ -463,6 +516,7 @@ class ProfileFrameDropType(GroupType):
slug = "profile_frame_drop"
description = "Frame Drop"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.RESPONSIVENESS.value
noise_config = NoiseConfig(ignore_limit=2000)
released = True
default_priority = PriorityLevel.LOW
Expand All @@ -474,6 +528,7 @@ class ProfileFunctionRegressionType(GroupType):
slug = "profile_function_regression"
description = "Function Regression"
category = GroupCategory.PERFORMANCE.value
category_v2 = GroupCategory.PERFORMANCE_BEST_PRACTICE.value
enable_auto_resolve = False
released = True
default_priority = PriorityLevel.MEDIUM
Expand All @@ -486,6 +541,7 @@ class MonitorIncidentType(GroupType):
slug = "monitor_check_in_failure"
description = "Crons Monitor Failed"
category = GroupCategory.CRON.value
category_v2 = GroupCategory.OUTAGE.value
released = True
creation_quota = Quota(3600, 60, 60_000) # 60,000 per hour, sliding window of 60 seconds
default_priority = PriorityLevel.HIGH
Expand Down Expand Up @@ -515,6 +571,7 @@ class ReplayRageClickType(ReplayGroupTypeDefaults, GroupType):
slug = "replay_click_rage"
description = "Rage Click Detected"
category = GroupCategory.REPLAY.value
category_v2 = GroupCategory.USER_EXPERIENCE.value
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig()
released = True
Expand All @@ -526,6 +583,7 @@ class ReplayHydrationErrorType(ReplayGroupTypeDefaults, GroupType):
slug = "replay_hydration_error"
description = "Hydration Error Detected"
category = GroupCategory.REPLAY.value
category_v2 = GroupCategory.USER_EXPERIENCE.value
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig()
released = True
Expand All @@ -537,6 +595,7 @@ class FeedbackGroup(GroupType):
slug = "feedback"
description = "Feedback"
category = GroupCategory.FEEDBACK.value
category_v2 = GroupCategory.FEEDBACK.value
creation_quota = Quota(3600, 60, 1000) # 1000 per hour, sliding window of 60 seconds
default_priority = PriorityLevel.MEDIUM
notification_config = NotificationConfig(context=[])
Expand All @@ -552,6 +611,7 @@ class MetricIssuePOC(GroupType):
slug = "metric_issue_poc"
description = "Metric Issue POC"
category = GroupCategory.METRIC_ALERT.value
category_v2 = GroupCategory.PERFORMANCE_REGRESSION.value
default_priority = PriorityLevel.HIGH
enable_auto_resolve = False
enable_escalation_detection = False
Expand Down
1 change: 1 addition & 0 deletions src/sentry/uptime/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class UptimeDomainCheckFailure(GroupType):
slug = "uptime_domain_failure"
description = "Uptime Domain Monitor Failure"
category = GroupCategory.UPTIME.value
category_v2 = GroupCategory.OUTAGE.value
creation_quota = Quota(3600, 60, 1000) # 1000 per hour, sliding window of 60 seconds
default_priority = PriorityLevel.HIGH
enable_auto_resolve = False
Expand Down
Loading
Loading