|
8 | 8 | from typing import TYPE_CHECKING, Any |
9 | 9 |
|
10 | 10 | from sentry.grouping.component import ( |
11 | | - BaseGroupingComponent, |
12 | 11 | ChainedExceptionGroupingComponent, |
13 | 12 | ContextLineGroupingComponent, |
14 | 13 | ErrorTypeGroupingComponent, |
|
23 | 22 | NSErrorDomainGroupingComponent, |
24 | 23 | NSErrorGroupingComponent, |
25 | 24 | StacktraceGroupingComponent, |
26 | | - ThreadNameGroupingComponent, |
27 | 25 | ThreadsGroupingComponent, |
28 | 26 | ) |
29 | 27 | from sentry.grouping.strategies.base import ( |
@@ -885,46 +883,24 @@ def threads( |
885 | 883 | def _get_thread_components( |
886 | 884 | threads: list[dict[str, Any]], event: Event, context: GroupingContext, **kwargs: dict[str, Any] |
887 | 885 | ) -> ComponentsByVariant | None: |
888 | | - # Only process single-thread scenarios (existing behavior) |
889 | | - # Multiple threads are ambiguous for grouping |
890 | 886 | if len(threads) != 1: |
891 | 887 | return None |
892 | 888 |
|
893 | | - thread = threads[0] |
894 | | - stacktrace = thread.get("stacktrace") |
895 | | - |
896 | | - # Check if config enables thread name in grouping via initial_context |
897 | | - include_thread_name = context.get("include_thread_name_in_grouping", False) |
898 | | - |
899 | | - # Collect thread metadata components (only thread name, as IDs are random) |
900 | | - thread_metadata: list[BaseGroupingComponent[str]] = [] |
901 | | - if include_thread_name and thread.get("name"): |
902 | | - thread_metadata.append( |
903 | | - ThreadNameGroupingComponent( |
904 | | - values=[thread["name"]], |
905 | | - contributes=True, |
906 | | - hint="thread name included in grouping", |
907 | | - ) |
908 | | - ) |
909 | | - |
910 | | - # If no stacktrace, return early (thread metadata can't group without frames) |
| 889 | + stacktrace = threads[0].get("stacktrace") |
911 | 890 | if not stacktrace: |
912 | 891 | return { |
913 | 892 | "app": ThreadsGroupingComponent( |
914 | 893 | contributes=False, hint="ignored because thread has no stacktrace" |
915 | 894 | ) |
916 | 895 | } |
917 | 896 |
|
918 | | - # Build stacktrace components for each variant with thread metadata |
919 | 897 | thread_components_by_variant = {} |
920 | 898 |
|
921 | 899 | for variant_name, stacktrace_component in context.get_grouping_components_by_variant( |
922 | 900 | stacktrace, event=event, **kwargs |
923 | 901 | ).items(): |
924 | 902 | thread_components_by_variant[variant_name] = ThreadsGroupingComponent( |
925 | | - values=[stacktrace_component], |
926 | | - frame_counts=stacktrace_component.frame_counts, |
927 | | - metadata=thread_metadata, |
| 903 | + values=[stacktrace_component], frame_counts=stacktrace_component.frame_counts |
928 | 904 | ) |
929 | 905 |
|
930 | 906 | return thread_components_by_variant |
|
0 commit comments