Skip to content

feat(search): Downrank capture_message issues in recommended sort#116588

Merged
roggenkemper merged 5 commits into
masterfrom
roggenkemper/feat/recommended-sort-message-penalty
Jun 3, 2026
Merged

feat(search): Downrank capture_message issues in recommended sort#116588
roggenkemper merged 5 commits into
masterfrom
roggenkemper/feat/recommended-sort-message-penalty

Conversation

@roggenkemper
Copy link
Copy Markdown
Member

@roggenkemper roggenkemper commented Jun 1, 2026

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 ValueError
at error level and a capture_message("disk low", level="error") — they
score 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 same
column 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 the
weight 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_stacks and are unaffected.

Ref ID-1580

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>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 1, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/sentry/search/snuba/executors.py
roggenkemper and others added 2 commits June 1, 2026 13:39
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
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 3, 2026

ID-1580

@roggenkemper roggenkemper marked this pull request as ready for review June 3, 2026 20:16
@roggenkemper roggenkemper requested review from a team as code owners June 3, 2026 20:16
@roggenkemper roggenkemper requested review from a team and removed request for a team June 3, 2026 20:16
@roggenkemper roggenkemper merged commit 498be0a into master Jun 3, 2026
85 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/feat/recommended-sort-message-penalty branch June 3, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants