Skip to content

Commit 8de0624

Browse files
authored
fix(uptime): Fix ttl bug for hour interval monitors (#87200)
Setting this to an hour means that hour long checks will sometimes not fire, or fire late, because the consecutive check values ends up ttled. Updating this to be dynamic based on the max interval, and adding an hour to account for any delays in processing. <!-- Describe your PR here. -->
1 parent 8812f8a commit 8de0624

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sentry/uptime/consumers/results_consumer.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@
6363
ONBOARDING_FAILURE_REDIS_TTL = ONBOARDING_MONITOR_PERIOD
6464
# How frequently we should run active auto-detected subscriptions
6565
AUTO_DETECTED_ACTIVE_SUBSCRIPTION_INTERVAL = timedelta(minutes=1)
66-
# The TTL of the redis key used to track consecutive statuses
67-
ACTIVE_THRESHOLD_REDIS_TTL = timedelta(minutes=60)
66+
# The TTL of the redis key used to track consecutive statuses. We need this to be longer than the longest interval we
67+
# support, so that the key doesn't expire between checks. We add an extra hour to account for any backlogs in
68+
# processing.
69+
ACTIVE_THRESHOLD_REDIS_TTL = timedelta(seconds=max(UptimeSubscription.IntervalSeconds)) + timedelta(
70+
minutes=60
71+
)
6872
SNUBA_UPTIME_RESULTS_CODEC: Codec[SnubaUptimeResult] = get_topic_codec(Topic.SNUBA_UPTIME_RESULTS)
6973
# We want to limit cardinality for provider tags. This controls how many tags we should include
7074
TOTAL_PROVIDERS_TO_INCLUDE_AS_TAGS = 30

0 commit comments

Comments
 (0)