Skip to content
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
36 changes: 17 additions & 19 deletions src/sentry/seer/similarity/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the original list before I started adding Java platforms.

[
"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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions tests/sentry/seer/similarity/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -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):
Expand Down
Loading