Skip to content

Commit

Permalink
Uptime monitor type and rule source
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrettscott committed Jan 2, 2025
1 parent 98f5c13 commit d688ae6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sentry/models/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
class RuleSource(IntEnum):
ISSUE = 0
CRON_MONITOR = 1
UPTIME = 2

@classmethod
def as_choices(cls) -> Sequence[tuple[int, str]]:
return (
(cls.ISSUE, "issue"),
(cls.CRON_MONITOR, "cron_monitor"),
(cls.UPTIME, "uptime_monitor"),
)


Expand Down
2 changes: 2 additions & 0 deletions src/sentry/monitors/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,14 @@ class MonitorType:
# monitors. But for now we just have CRON_JOB style monitors.
UNKNOWN = 0
CRON_JOB = 3
UPTIME = 4

@classmethod
def as_choices(cls):
return (
(cls.UNKNOWN, "unknown"),
(cls.CRON_JOB, "cron_job"),
(cls.UPTIME, "uptime"),
)

@classmethod
Expand Down

0 comments on commit d688ae6

Please sign in to comment.