Skip to content

Commit 3d6bfb2

Browse files
committed
remove get_stacktrace_string_with_metrics
1 parent 8e8a379 commit 3d6bfb2

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

src/sentry/grouping/ingest/seer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ReferrerOptions,
2222
event_content_has_stacktrace,
2323
filter_null_from_string,
24-
get_stacktrace_string_with_metrics,
24+
get_stacktrace_string,
2525
has_too_many_contributing_frames,
2626
killswitch_enabled,
2727
record_did_call_seer_metric,
@@ -215,9 +215,7 @@ def _has_empty_stacktrace_string(event: Event, variants: dict[str, BaseVariant])
215215
if contributing_component is not None and hasattr(contributing_component, "frame_counts"):
216216
logger_extra["frame_counts"] = contributing_component.frame_counts
217217

218-
stacktrace_string = get_stacktrace_string_with_metrics(
219-
get_grouping_info_from_variants(variants)
220-
)
218+
stacktrace_string = get_stacktrace_string(get_grouping_info_from_variants(variants))
221219
if not stacktrace_string:
222220
if stacktrace_string == "":
223221
record_did_call_seer_metric(call_made=False, blocker="empty-stacktrace-string")
@@ -243,7 +241,7 @@ def get_seer_similar_issues(
243241

244242
stacktrace_string = event.data.get(
245243
"stacktrace_string",
246-
get_stacktrace_string_with_metrics(get_grouping_info_from_variants(variants)),
244+
get_stacktrace_string(get_grouping_info_from_variants(variants)),
247245
)
248246

249247
if not stacktrace_string:

src/sentry/seer/similarity/utils.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,6 @@ def is_base64_encoded_frame(frame_dict: Mapping[str, Any]) -> bool:
255255
return base64_encoded
256256

257257

258-
def get_stacktrace_string_with_metrics(data: dict[str, Any]) -> str | None:
259-
stacktrace_string = None
260-
try:
261-
stacktrace_string = get_stacktrace_string(data)
262-
except Exception:
263-
logger.exception("Unexpected exception in stacktrace string formatting")
264-
265-
return stacktrace_string
266-
267-
268258
def event_content_has_stacktrace(event: GroupEvent | Event) -> bool:
269259
# If an event has no stacktrace, there's no data for Seer to analyze, so no point in making the
270260
# API call. If we ever start analyzing message-only events, we'll need to add `event.title in

src/sentry/tasks/embeddings_grouping/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
ReferrerOptions,
3535
event_content_has_stacktrace,
3636
filter_null_from_string,
37-
get_stacktrace_string_with_metrics,
37+
get_stacktrace_string,
3838
has_too_many_contributing_frames,
3939
)
4040
from sentry.snuba.dataset import Dataset
@@ -373,7 +373,7 @@ def get_events_from_nodestore(
373373

374374
if not has_too_many_contributing_frames(event, variants, ReferrerOptions.BACKFILL):
375375
grouping_info = get_grouping_info_from_variants(variants)
376-
stacktrace_string = get_stacktrace_string_with_metrics(grouping_info)
376+
stacktrace_string = get_stacktrace_string(grouping_info)
377377

378378
if not stacktrace_string:
379379
invalid_event_group_ids.append(group_id)

tests/sentry/seer/similarity/test_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
_is_snipped_context_line,
1616
filter_null_from_string,
1717
get_stacktrace_string,
18-
get_stacktrace_string_with_metrics,
1918
has_too_many_contributing_frames,
2019
)
2120
from sentry.testutils.cases import TestCase
@@ -796,7 +795,7 @@ def test_replace_file_with_module(self):
796795
exception = copy.deepcopy(self.BASE_APP_DATA)
797796
# delete filename from the exception
798797
del exception["app"]["component"]["values"][0]["values"][0]["values"][0]["values"][1]
799-
stacktrace_string = get_stacktrace_string_with_metrics(exception)
798+
stacktrace_string = get_stacktrace_string(exception)
800799
assert (
801800
stacktrace_string
802801
== 'ZeroDivisionError: division by zero\n File "__main__", function divide_by_zero\n divide = 1/0'

0 commit comments

Comments
 (0)