Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wedamija
Copy link
Member

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.

@wedamija wedamija requested a review from a team as a code owner February 21, 2025 00:54
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 21, 2025
Base automatically changed from danf/uptime-region-override-switchover to master February 21, 2025 18:04
@wedamija wedamija force-pushed the danf/uptime-assign-shadow-regions branch from de9ac7d to 574cb61 Compare February 21, 2025 18:05
@wedamija wedamija requested review from a team as code owners February 21, 2025 20:09
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 21, 2025
Copy link
Contributor

🚨 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 #discuss-dev-infra channel.

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.
@wedamija wedamija force-pushed the danf/uptime-assign-shadow-regions branch from 8eabcf5 to 5c6d25a Compare February 21, 2025 20:10
@wedamija wedamija removed request for a team February 21, 2025 20:11
@wedamija wedamija requested review from a team and removed request for a team February 21, 2025 20:11
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()}
Copy link
Member

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

Comment on lines +13 to +16
@dataclasses.dataclass(frozen=True)
class UptimeRegionWithMode:
slug: str
mode: UptimeSubscriptionRegion.RegionMode = UptimeSubscriptionRegion.RegionMode.ACTIVE
Copy link
Member

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?

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants