Skip to content

Commit 839c94d

Browse files
committed
remove get_stacktrace_string_with_metrics
1 parent 994f75d commit 839c94d

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
@@ -20,7 +20,7 @@
2020
ReferrerOptions,
2121
event_content_has_stacktrace,
2222
filter_null_from_string,
23-
get_stacktrace_string_with_metrics,
23+
get_stacktrace_string,
2424
has_too_many_contributing_frames,
2525
killswitch_enabled,
2626
record_did_call_seer_metric,
@@ -200,9 +200,7 @@ def _circuit_breaker_broken(event: Event, project: Project) -> bool:
200200

201201

202202
def _has_empty_stacktrace_string(event: Event, variants: dict[str, BaseVariant]) -> bool:
203-
stacktrace_string = get_stacktrace_string_with_metrics(
204-
get_grouping_info_from_variants(variants)
205-
)
203+
stacktrace_string = get_stacktrace_string(get_grouping_info_from_variants(variants))
206204
if not stacktrace_string:
207205
if stacktrace_string == "":
208206
record_did_call_seer_metric(call_made=False, blocker="empty-stacktrace-string")
@@ -228,7 +226,7 @@ def get_seer_similar_issues(
228226

229227
stacktrace_string = event.data.get(
230228
"stacktrace_string",
231-
get_stacktrace_string_with_metrics(get_grouping_info_from_variants(variants)),
229+
get_stacktrace_string(get_grouping_info_from_variants(variants)),
232230
)
233231

234232
if not stacktrace_string:

src/sentry/seer/similarity/utils.py

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

280280

281-
def get_stacktrace_string_with_metrics(data: dict[str, Any]) -> str | None:
282-
stacktrace_string = None
283-
try:
284-
stacktrace_string = get_stacktrace_string(data)
285-
except Exception:
286-
logger.exception("Unexpected exception in stacktrace string formatting")
287-
288-
return stacktrace_string
289-
290-
291281
def event_content_has_stacktrace(event: GroupEvent | Event) -> bool:
292282
# If an event has no stacktrace, there's no data for Seer to analyze, so no point in making the
293283
# 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
@@ -364,7 +364,7 @@ def get_events_from_nodestore(
364364

365365
if not has_too_many_contributing_frames(event, variants, ReferrerOptions.BACKFILL):
366366
grouping_info = get_grouping_info_from_variants(variants)
367-
stacktrace_string = get_stacktrace_string_with_metrics(grouping_info)
367+
stacktrace_string = get_stacktrace_string(grouping_info)
368368

369369
if not stacktrace_string:
370370
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)