Skip to content

Crons: Add support for multiple environments #42788

Closed
@gaprl

Description

@gaprl

Currently, a Cron Monitor does not support multiple environments such as "production", "development", etc.


Current estimated delivery: 03/22/23

Spec from @evanpurkhiser

We'll need to make some data model updates and adjust some assumptions about how monitors currently store status.

Adding environments means that each checkin entry will now be associated to an environment (or the default empty string).

  1. Monitor status can no longer be denormalized onto the monitor object. The status needs to come from the most recent checkin for the selected environment(s). The status of the monitor will become dependent on the most recent checkin.

  2. Each monitor should have a list of activated environments associated to it. We should introduce a monitorenvironment model that has a FK to the monitor and a FK to the project environment.

  3. next checkin time needs to move to the environment.

  4. Checkin details should be specific to a single environment. It does not make sense to try and show checkins for a monitor across multiple environments.

  5. When listing monitors we should only allow selection of a single environment.

  6. Checkins must now accept the environment for which the checkin is associated to. (If none is passed it should default to production (see environment in the link))

  7. The check_monitors task now needs to take into account each environment as well, so we'll need to update the query to join on the monitor_environments table.

### Tasks
- [ ] https://github.com/getsentry/sentry/issues/45009
- [ ] https://github.com/getsentry/sentry/issues/45011
- [ ] https://github.com/getsentry/sentry/issues/45013
- [ ] https://github.com/getsentry/sentry/issues/45017
- [ ] https://github.com/getsentry/sentry/issues/45022
- [ ] https://github.com/getsentry/sentry/issues/45019
- [ ] https://github.com/getsentry/sentry/issues/45020
- [ ] https://github.com/getsentry/sentry/issues/45023
- [ ] https://github.com/getsentry/sentry/issues/45024
- [ ] https://github.com/getsentry/sentry/issues/45025
- [ ] https://github.com/getsentry/sentry/issues/45994
- [ ] https://github.com/getsentry/sentry/issues/46137
- [ ] https://github.com/getsentry/sentry/issues/47854
- [ ] https://github.com/getsentry/sentry/issues/47855

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Beta Availability

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions