feat(search): Downrank capture_message issues in recommended sort#116588
Merged
roggenkemper merged 5 commits intoJun 3, 2026
Conversation
Add a message penalty signal to the recommended sort formula that downranks issues without exception data (e.g. from capture_message). Uses exception_stacks.type to detect whether events have real stacktraces — pure message groups get a configurable penalty (default 0.10) while exception groups are unaffected. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a5ce2e5. Configure here.
The +1 in the denominator prevented the has_exception_ratio from reaching 1.0 for exception-only groups, causing them to receive a small residual penalty instead of zero. Co-Authored-By: Claude <noreply@anthropic.com>
…ecommended-sort-message-penalty # Conflicts: # src/sentry/search/snuba/executors.py # tests/snuba/search/test_backend.py
Co-Authored-By: Claude <noreply@anthropic.com>
shashjar
approved these changes
Jun 3, 2026
scttcper
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add a message penalty signal to the recommended sort formula that downranks
issues created by
capture_message(or any event without exception data).The existing severity signal doesn't distinguish between a real
ValueErrorat error level and a
capture_message("disk low", level="error")— theyscore identically. This means message-only issues compete equally with
real exceptions for attention in the issue stream.
This adds a new weighted signal that checks
exception_stacks.type(the samecolumn already used by the trends sort) to compute what fraction of a group's
events have real exception data. Groups where no events have exceptions get
the full penalty, exception-only groups get zero penalty, and mixed groups
get a proportional penalty. The penalty is subtracted from the score.
The penalty weight is configurable via
snuba.search.recommended.message-penalty-weight(FLAG_AUTOMATOR_MODIFIABLE).It defaults to
0, so merging this is a no-op — the signal is off until theweight is raised via options, and a zero weight skips the computation entirely.
Only applies to the Events dataset — issue-platform occurrences don't have
exception_stacksand are unaffected.Ref ID-1580