Skip to content

Commit e1bbfc9

Browse files
ref(crons): Produce missed check-ins for muted monitors (#70343)
With the completion of GH-58410 we should be able to support increasing the task load for marking muted monitors as missing.
1 parent b8c4c3c commit e1bbfc9

File tree

2 files changed

+12
-37
lines changed

2 files changed

+12
-37
lines changed

src/sentry/monitors/clock_tasks/check_missed.py

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,18 @@
3232

3333
# re-use the monitor exclusion query node across dispatch_check_missing and
3434
# mark_environment_missing.
35-
IGNORE_MONITORS = (
36-
~Q(
37-
status__in=[
38-
MonitorStatus.DISABLED,
39-
MonitorStatus.PENDING_DELETION,
40-
MonitorStatus.DELETION_IN_PROGRESS,
41-
]
42-
)
43-
& ~Q(
44-
monitor__status__in=[
45-
ObjectStatus.DISABLED,
46-
ObjectStatus.PENDING_DELETION,
47-
ObjectStatus.DELETION_IN_PROGRESS,
48-
]
49-
)
50-
& ~Q(
51-
# TODO(epurkhiser): This is a hold-over from when we were producing
52-
# these tasks into celery. Removing this conditional will create many
53-
# more monitors for us to mark as missed. We should be able to remove
54-
# now that we're using a kafka consumer to process these
55-
monitor__is_muted=True,
56-
)
57-
& ~Q(
58-
# TODO(epurkhiser): This is a hold-over from when we were producing
59-
# these tasks into celery. Removing this conditional will create many
60-
# more monitors for us to mark as missed. We should be able to remove
61-
# now that we're using a kafka consumer to process these
62-
is_muted=True,
63-
)
35+
IGNORE_MONITORS = ~Q(
36+
status__in=[
37+
MonitorStatus.DISABLED,
38+
MonitorStatus.PENDING_DELETION,
39+
MonitorStatus.DELETION_IN_PROGRESS,
40+
]
41+
) & ~Q(
42+
monitor__status__in=[
43+
ObjectStatus.DISABLED,
44+
ObjectStatus.PENDING_DELETION,
45+
ObjectStatus.DELETION_IN_PROGRESS,
46+
]
6447
)
6548

6649

tests/sentry/monitors/clock_tasks/test_check_missed.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,6 @@ def test_missing_checkin_but_pending_deletion(self):
490490
def test_missing_checkin_but_deletion_in_progress(self):
491491
self.assert_state_does_not_change_for_status(ObjectStatus.DELETION_IN_PROGRESS)
492492

493-
# Temporary test until we can move out of celery or reduce load
494-
def test_missing_checkin_but_muted(self):
495-
self.assert_state_does_not_change_for_status(ObjectStatus.ACTIVE, is_muted=True)
496-
497-
# Temporary test until we can move out of celery or reduce load
498-
def test_missing_checkin_but_environment_muted(self):
499-
self.assert_state_does_not_change_for_status(ObjectStatus.ACTIVE, environment_is_muted=True)
500-
501493
@mock.patch("sentry.monitors.clock_tasks.check_missed.produce_task")
502494
def test_not_missing_checkin(self, mock_produce_task):
503495
"""

0 commit comments

Comments
 (0)