Skip to content

perf(alerts): Limit GroupEvent processing to relevant groups #91659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025

Conversation

kcons
Copy link
Member

@kcons kcons commented May 14, 2025

Restrict our rulegroup_to_eventdata mapping in get_group_to_groupevent to relevant groups early on.
This means that instead of fetching every event and occurrence for every rule, it only fetches those for the groups currently being processed.
Logic below in build_group_to_groupevent already walks this mapping and drops any that aren't in our set of passed in Groups (logging them as missing), so the end result should be the same (though with less log noise).

It's not clear how much perf benefit we expect to see from this, but it does make the behavior a bit clearer, avoids suspicious logs in a situation that is expected, and potentially asks significantly less work of our nodestore bulk fetches, so it seems promising.

@kcons kcons requested a review from a team as a code owner May 14, 2025 19:59
@kcons kcons requested review from cathteng and removed request for a team May 14, 2025 19:59
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 14, 2025
Copy link
Member

@cathteng cathteng left a comment

Choose a reason for hiding this comment

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

test?

Copy link

codecov bot commented May 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Error parsing JUnit XML in /home/runner/work/sentry/sentry/.artifacts/pytest.junit.xml at 1:159170

Caused by:
RuntimeError: Error validating attribute

Caused by:
    string is too long
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #91659   +/-   ##
=======================================
  Coverage   87.64%   87.64%           
=======================================
  Files       10349    10349           
  Lines      586396   586409   +13     
  Branches    22559    22559           
=======================================
+ Hits       513954   513968   +14     
+ Misses      71996    71995    -1     
  Partials      446      446           

@kcons kcons force-pushed the kcons/filtered branch from fddf680 to 4ec2131 Compare May 16, 2025 17:50
@kcons kcons enabled auto-merge (squash) May 16, 2025 17:50
@kcons kcons merged commit 9d8127e into master May 16, 2025
59 checks passed
@kcons kcons deleted the kcons/filtered branch May 16, 2025 18:10
andrewshie-sentry pushed a commit that referenced this pull request May 20, 2025
Restrict our rulegroup_to_eventdata mapping in `get_group_to_groupevent`
to relevant groups early on.
This means that instead of fetching every event and occurrence for every
rule, it only fetches those for the groups currently being processed.
Logic below in `build_group_to_groupevent` already walks this mapping
and drops any that aren't in our set of passed in Groups (logging them
as missing), so the end result should be the same (though with less log
noise).

It's not clear how much perf benefit we expect to see from this, but it
does make the behavior a bit clearer, avoids suspicious logs in a
situation that is expected, and potentially asks significantly less work
of our nodestore bulk fetches, so it seems promising.
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.

2 participants