Skip to content

Commit 934945f

Browse files
authored
chore(uptime): Bump ACTIVE_FAILURE_THRESHOLD to 3 (#76218)
Since we're moving to 60 second intervals, we want a slightly higher failure threshold <!-- Describe your PR here. -->
1 parent 579c70a commit 934945f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: src/sentry/uptime/consumers/results_consumer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
AUTO_DETECTED_ACTIVE_SUBSCRIPTION_INTERVAL = timedelta(minutes=1)
4848
# When in active monitoring mode, how many failures in a row do we need to see to mark the monitor as down, or how many
4949
# successes in a row do we need to mark it up
50-
ACTIVE_FAILURE_THRESHOLD = 2
50+
ACTIVE_FAILURE_THRESHOLD = 3
5151
ACTIVE_RECOVERY_THRESHOLD = 1
5252
# The TTL of the redis key used to track consecutive statuses
5353
ACTIVE_THRESHOLD_REDIS_TTL = timedelta(minutes=60)

Diff for: tests/sentry/uptime/consumers/test_results_consumers.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def test(self):
7373
)
7474
with mock.patch(
7575
"sentry.uptime.consumers.results_consumer.metrics"
76-
) as metrics, self.feature("organizations:uptime-create-issues"):
76+
) as metrics, self.feature("organizations:uptime-create-issues"), mock.patch(
77+
"sentry.uptime.consumers.results_consumer.ACTIVE_FAILURE_THRESHOLD",
78+
new=2,
79+
):
7780
self.send_result(result)
7881
metrics.incr.assert_has_calls(
7982
[
@@ -231,7 +234,10 @@ def test_no_create_issues_feature(self):
231234
def test_resolve(self):
232235
with mock.patch(
233236
"sentry.uptime.consumers.results_consumer.metrics"
234-
) as metrics, self.feature("organizations:uptime-create-issues"):
237+
) as metrics, self.feature("organizations:uptime-create-issues"), mock.patch(
238+
"sentry.uptime.consumers.results_consumer.ACTIVE_FAILURE_THRESHOLD",
239+
new=2,
240+
):
235241
self.send_result(
236242
self.create_uptime_result(
237243
self.subscription.subscription_id,

0 commit comments

Comments
 (0)