-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Process delayed alert conditions in batches of 10,000 #75302
Changes from 1 commit
79ba7d0
1ed44ad
70cbbb4
5225441
8b20402
7aafed8
cdf288f
d39202e
9af164b
c94c18e
41fbcb7
c1a7982
ba6b28d
b767878
267d71d
c29c5e3
babca17
1cd92fe
834445d
4bac969
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2636,3 +2636,7 @@ | |
default=1, | ||
flags=FLAG_AUTOMATOR_MODIFIABLE, | ||
) | ||
register( | ||
"delayed_processing.batch_size", | ||
default=10000, | ||
) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
import sentry_sdk | ||
from django.db.models import OuterRef, Subquery | ||
|
||
from sentry import buffer, nodestore | ||
from sentry import buffer, nodestore, options | ||
from sentry.buffer.redis import BufferHookEvent, redis_buffer_registry | ||
from sentry.db import models | ||
from sentry.eventstore.models import Event, GroupEvent | ||
|
@@ -47,7 +47,7 @@ | |
logger = logging.getLogger("sentry.rules.delayed_processing") | ||
EVENT_LIMIT = 100 | ||
COMPARISON_INTERVALS_VALUES = {k: v[1] for k, v in COMPARISON_INTERVALS.items()} | ||
CHUNK_BATCH_SIZE = 10000 | ||
CHUNK_BATCH_SIZE = options.get("delayed_processing.batch_size") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't set this as a module variable - it'll never update (and might cause problems on load). We just need to perform the check in function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh, ty, i was just about to ask to check if did that right. thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, just updated again, anything else i'm missing with the options? (I was looking at the docs here: https://develop.sentry.dev/backend/options/ to add it). ps, thanks for the help! |
||
|
||
|
||
class UniqueConditionQuery(NamedTuple): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You just need to add
flags=FLAG_AUTOMATOR_MODIFIABLE
and then you'll be good to go