-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat(uptime): Allow regions to be configured as shadow mode #85609
base: master
Are you sure you want to change the base?
Conversation
de9ac7d
to
574cb61
Compare
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
This introduces shadow mode to our uptime region system. Configs are partitioned separately between shadow/active. So if regions 1, 2 are active, and 3,4 are shadow, then configs going to regions 1/2 will have just regions 1/2 as their active regions. Configs going 3/4 will also only have regions 3/4 as their active regions. This uses the same override system we use to disable regions. Regions will be slowly migrated over to shadow mode over time. Note that this pr doesn't handle the last piece required here - we need to ignore results produced by shadow regions. That will be handled in a follow up pr.
8eabcf5
to
5c6d25a
Compare
r.region_slug: UptimeSubscriptionRegion.RegionMode(r.mode) | ||
for r in subscription.regions.all() | ||
} | ||
active_regions = {c.slug: mode for c, mode in get_active_region_configs()} |
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.
probably should be active_region_modes
also
@dataclasses.dataclass(frozen=True) | ||
class UptimeRegionWithMode: | ||
slug: str | ||
mode: UptimeSubscriptionRegion.RegionMode = UptimeSubscriptionRegion.RegionMode.ACTIVE |
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.
wdyt about moving this into sentry.uptime.types
module?
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.
Both the UptimeRegionWithMode
and the RegionMode
things
This introduces shadow mode to our uptime region system. Configs are partitioned separately between shadow/active. So if regions 1, 2 are active, and 3,4 are shadow, then configs going to regions 1/2 will have just regions 1/2 as their active regions. Configs going 3/4 will also only have regions 3/4 as their active regions.
This uses the same override system we use to disable regions. Regions will be slowly migrated over to shadow mode over time.
Note that this pr doesn't handle the last piece required here - we need to ignore results produced by shadow regions. That will be handled in a follow up pr.