diff --git a/src/sentry/seer/similarity/utils.py b/src/sentry/seer/similarity/utils.py index b92fd1858d81df..25288457741680 100644 --- a/src/sentry/seer/similarity/utils.py +++ b/src/sentry/seer/similarity/utils.py @@ -25,17 +25,14 @@ "ruby", ] ) -SEER_ELIGIBLE_PLATFORMS = frozenset( +# An original set of platforms were backfilled allowing more than 30 system contributing frames +# being set to seer. Unfortunately, this can cause over grouping. We will need to reduce +# these set of platforms but for now we will blacklist them. +SYSTEM_FRAME_CHECK_BLACKLIST_PLATFORMS = frozenset( [ - "android", - "android-profiling-onboarding-1-install", - "android-profiling-onboarding-3-configure-profiling", - "android-profiling-onboarding-4-upload", "bun", - "dart", "deno", "django", - "flutter", "go", "go-echo", "go-fasthttp", @@ -45,16 +42,6 @@ "go-iris", "go-martini", "go-negroni", - "groovy", - "java", - "java-android", - "java-appengine", - "java-log4j", - "java-log4j2", - "java-logging", - "java-logback", - "java-spring", - "java-spring-boot", "javascript", "javascript-angular", "javascript-angularjs", @@ -144,8 +131,15 @@ "ruby-rails", ] ) -SYSTEM_FRAME_CHECK_PLATFORMS = frozenset( +SEER_ELIGIBLE_PLATFORMS = SYSTEM_FRAME_CHECK_BLACKLIST_PLATFORMS | frozenset( [ + "android", + "android-profiling-onboarding-1-install", + "android-profiling-onboarding-3-configure-profiling", + "android-profiling-onboarding-4-upload", + "dart", + "flutter", + "groovy", "java", "java-android", "java-appengine", @@ -293,7 +287,11 @@ def _process_frames(frames: list[dict[str, Any]]) -> list[str]: exc_value = _get_value_if_exists(exception_value) elif exception_value.get("id") == "stacktrace" and frame_count < MAX_FRAME_COUNT: frame_strings = _process_frames(exception_value["values"]) - if platform in SYSTEM_FRAME_CHECK_PLATFORMS and is_frames_truncated and not app_hash: + if ( + platform not in SYSTEM_FRAME_CHECK_BLACKLIST_PLATFORMS + and is_frames_truncated + and not app_hash + ): raise TooManyOnlySystemFramesException if has_no_filename_or_module: raise NoFilenameOrModuleException diff --git a/tests/sentry/seer/similarity/test_utils.py b/tests/sentry/seer/similarity/test_utils.py index 25a2efad431a03..c5ca9ee76dd1a9 100644 --- a/tests/sentry/seer/similarity/test_utils.py +++ b/tests/sentry/seer/similarity/test_utils.py @@ -736,10 +736,7 @@ def test_too_many_system_frames_single_exception_invalid_platform(self): "values" ] += self.create_frames(MAX_FRAME_COUNT + 1, True) - stacktrace_string = get_stacktrace_string(data_system) - assert stacktrace_string is not None and stacktrace_string != "" - - stacktrace_string = get_stacktrace_string(data_system, platform="python") + stacktrace_string = get_stacktrace_string(data_system, "python") assert stacktrace_string is not None and stacktrace_string != "" def test_too_many_system_frames_chained_exception(self): @@ -767,16 +764,13 @@ def test_too_many_system_frames_chained_exception_invalid_platform(self): "values" ] += self.create_frames(MAX_FRAME_COUNT // 2, True) - stacktrace_string = get_stacktrace_string(data_system) - assert stacktrace_string is not None and stacktrace_string != "" - - stacktrace_string = get_stacktrace_string(data_system, platform="python") + stacktrace_string = get_stacktrace_string(data_system, "python") assert stacktrace_string is not None and stacktrace_string != "" def test_too_many_in_app_contributing_frames(self): """ Check that when there are over MAX_FRAME_COUNT contributing frames, the last MAX_FRAME_COUNT - are included. + is included. """ data_frames = copy.deepcopy(self.BASE_APP_DATA) # Create 30 contributing frames, 1-20 -> last 10 should be included @@ -791,7 +785,7 @@ def test_too_many_in_app_contributing_frames(self): data_frames["app"]["component"]["values"][0]["values"][0]["values"] += self.create_frames( 20, True, 41 ) - stacktrace_str = get_stacktrace_string(data_frames) + stacktrace_str = get_stacktrace_string(data_frames, "java") num_frames = 0 for i in range(1, 11):