Skip to content

Conversation

@evanpurkhiser
Copy link
Member

Switches reading of uptime_status (and uptime_status_update_date) to
the uptime_subscription model.

We'll need this to migrate to reading from detectors (and implementing
the detector handler)

@evanpurkhiser evanpurkhiser requested review from a team as code owners April 25, 2025 21:08
@evanpurkhiser evanpurkhiser removed the request for review from a team April 25, 2025 21:08
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 25, 2025
@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-uptime-read-uptime-status-from-uptime-subscription branch from f1950d2 to c143d74 Compare April 25, 2025 21:36
@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #90434       +/-   ##
===========================================
+ Coverage   42.26%   87.80%   +45.53%     
===========================================
  Files       10255    10281       +26     
  Lines      582397   583445     +1048     
  Branches    22579    22579               
===========================================
+ Hits       246168   512281   +266113     
+ Misses     335798    70733   -265065     
  Partials      431      431               

@evanpurkhiser evanpurkhiser force-pushed the evanpurkhiser/ref-uptime-read-uptime-status-from-uptime-subscription branch from c143d74 to beb211c Compare May 1, 2025 19:28
@evanpurkhiser
Copy link
Member Author

Verified all the status's match using this query

select
  sub.id as sub_id,
  sub.uptime_status as sub_uptime_status,
  sub.uptime_status_update_date :: text as sub_uptime_status_update_date,
  pus.uptime_status as pus_uptime_status,
  pus.uptime_status_update_date :: text as pus_uptime_status_update_date
from
  uptime_uptimesubscription sub
  join uptime_projectuptimesubscription pus on sub.id = pus.uptime_subscription_id
where

   -- Find mismatched uptime_status
   (
    sub.uptime_status != pus.uptime_status
    -- Trim off the minute, we were dual writing slightly different values due to two calls to `timezone.now()`
    or date_trunc('minute', sub.uptime_status_update_date) != date_trunc('minute', pus.uptime_status_update_date)
  )

@evanpurkhiser evanpurkhiser merged commit 5020e8d into master May 1, 2025
60 checks passed
@evanpurkhiser evanpurkhiser deleted the evanpurkhiser/ref-uptime-read-uptime-status-from-uptime-subscription branch May 1, 2025 20:27
@sentry
Copy link

sentry bot commented May 3, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ UptimeSubscription.DoesNotExist: UptimeSubscription matching query does not exist. monitors.uptime.result_consumer View Issue
  • ‼️ UptimeSubscription.DoesNotExist: UptimeSubscription matching query does not exist. monitors.uptime.result_consumer View Issue
  • ‼️ OperationalError: OperationalError('server closed the connection unexpectedly\n\tThis probably means the server terminated abnormally\n\tbefore or while processing the request.\n') monitors.uptime.result_consumer View Issue

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request May 12, 2025
Switches reading of `uptime_status` (and `uptime_status_update_date`) to
the `uptime_subscription` model.

We'll need this to migrate to reading from detectors (and implementing
the detector handler)
@github-actions github-actions bot locked and limited conversation to collaborators May 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants