-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(uptime): Add uptime monitor count endpoint #92583
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): Add uptime monitor count endpoint #92583
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #92583 +/- ##
========================================
Coverage 87.89% 87.89%
========================================
Files 10239 10241 +2
Lines 587082 587222 +140
Branches 22806 22806
========================================
+ Hits 515998 516129 +131
- Misses 70658 70667 +9
Partials 426 426 |
| queryset = ProjectUptimeSubscription.objects.filter( | ||
| project__organization_id=organization.id, project_id__in=filter_params["project_id"] | ||
| ).exclude( | ||
| status__in=[ | ||
| ObjectStatus.PENDING_DELETION, | ||
| ObjectStatus.DELETION_IN_PROGRESS, | ||
| ] | ||
| ) |
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.
Could you actually have this pull from the Detector model instead? Here's where we create those from project subs
sentry/src/sentry/uptime/models.py
Lines 401 to 412 in ad75d51
| detector = Detector.objects.create( | |
| type=GROUP_TYPE_UPTIME_DOMAIN_CHECK_FAILURE, | |
| project=project_sub.project, | |
| name=project_sub.name, | |
| owner_user_id=project_sub.owner_user_id, | |
| owner_team_id=project_sub.owner_team_id, | |
| config={ | |
| "environment": env, | |
| "mode": project_sub.mode, | |
| }, | |
| workflow_condition_group=condition_group, | |
| ) |
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.
Yup! Changed to check that instead
Similar to #92574, but for uptime monitors