Skip to content

Commit df699cc

Browse files
authored
Use external_type for grouping strategy names (#94502)
<!-- Describe your PR here. --> [Ticket](https://linear.app/getsentry/issue/ID-246/grouping-info-name-things-in-more-recognizable-ways) Modify `strategy` to prefer `interface.external_type` over `interface.path` for strategy names, allowing interfaces to customize their display names in grouping hints without affecting their core path identifier. Only two Interfaces have an `external_type`: `logentry` and `debug_meta`. Since `debug_meta` is not part of hints, this will change just one interface hint: `logentry` will be referred to as `message`
1 parent 3097b96 commit df699cc

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/sentry/grouping/strategies/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def strategy(
7575
in the event, only exception will be used for hash
7676
"""
7777

78-
name = interface.path
78+
name = interface.external_type
7979

8080
if not ids:
8181
raise TypeError("no ids given")

src/sentry/interfaces/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def path(cls):
7979
def external_type(cls):
8080
"""The external name of the interface. This is mostly the same as
8181
path with some small differences (message, debugmeta).
82+
Also used as the display name for grouping strategy hints.
8283
"""
8384
return cls.path
8485

tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/legacy@2019_03_12/block_invoke.pysnap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
created: '2025-02-26T00:33:37.643566+00:00'
2+
created: '2025-06-27T19:26:06.169641+00:00'
33
creator: sentry
44
source: tests/sentry/grouping/test_variants.py
55
---
66
app:
77
hash: null
88
contributing component: null
99
component:
10-
app (logentry takes precedence)
10+
app (message takes precedence)
1111
threads
1212
stacktrace
1313
frame
@@ -32,7 +32,7 @@ system:
3232
hash: null
3333
contributing component: null
3434
component:
35-
system (logentry takes precedence)
35+
system (message takes precedence)
3636
threads
3737
stacktrace
3838
frame

tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/legacy@2019_03_12/cocoa_dispatch_client_callout.pysnap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
created: '2025-04-29T22:29:14.124783+00:00'
2+
created: '2025-06-27T19:26:06.340999+00:00'
33
creator: sentry
44
source: tests/sentry/grouping/test_variants.py
55
---
66
app:
77
hash: null
88
contributing component: null
99
component:
10-
app (logentry takes precedence)
10+
app (message takes precedence)
1111
threads
1212
stacktrace
1313
frame (marked in-app by stack trace rule (family:native package:**/Containers/Bundle/Application/** +app))
@@ -68,7 +68,7 @@ system:
6868
hash: null
6969
contributing component: null
7070
component:
71-
system (logentry takes precedence)
71+
system (message takes precedence)
7272
threads
7373
stacktrace
7474
frame

tests/sentry/grouping/snapshots/test_variants/test_event_hash_variant/legacy@2019_03_12/unreal_event_capture_mac.pysnap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
created: '2025-02-19T15:24:59.578125+00:00'
2+
created: '2025-06-27T19:26:10.991077+00:00'
33
creator: sentry
44
source: tests/sentry/grouping/test_variants.py
55
---
66
app:
77
hash: null
88
contributing component: null
99
component:
10-
app (logentry takes precedence)
10+
app (message takes precedence)
1111
threads (ignored because contains 63 threads)
1212
--------------------------------------------------------------------------
1313
default:
@@ -22,5 +22,5 @@ system:
2222
hash: null
2323
contributing component: null
2424
component:
25-
system (logentry takes precedence)
25+
system (message takes precedence)
2626
threads (ignored because contains 63 threads)

0 commit comments

Comments
 (0)