-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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): Tasks for automatic hostname detection and monitoring #73258
Conversation
src/sentry/uptime/detectors/tasks.py
Outdated
delete_candidate_urls_for_project(project) | ||
|
||
|
||
def check_url(project: Project, project_url_count: int, url: str, url_count: int) -> bool: |
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.
Tbh I'd prefer to break most of the logic out of tasks.py
but just haven't gotten around to it yet.
This implements most of the second half of automatic hostname detection and monitoring. It has a few components: - `schedule_detections` runs every minute. It looks at the last time it was run, and fires off tasks for each minute bucket. - `process_detection_bucket` runs for a specific datetime bucket. It just fetches all projects from this bucket and fires `process_project_url_ranking` for each of them. Note that each project will only belong to a single bucket. - `process_project_url_ranking` runs for a specific project. This is where the meat of the logic exists. We get the ranked list of urls collected from this project's event data and run it through various criteria to see whether we should attempt to monitor the url There are a fair few todos around that I need to finish up, as well as building the logic to send subscriptions to the topic for our rust consumer.
a4dfc6f
to
173a280
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #73258 +/- ##
========================================
Coverage 78.01% 78.02%
========================================
Files 6632 6633 +1
Lines 296124 296222 +98
Branches 50999 51014 +15
========================================
+ Hits 231031 231137 +106
+ Misses 58807 58799 -8
Partials 6286 6286
|
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This implements most of the second half of automatic hostname detection and monitoring. It has a few components:
schedule_detections
runs every minute. It looks at the last time it was run, and fires off tasks for each minute bucket.process_detection_bucket
runs for a specific datetime bucket. It just fetches all projects from this bucket and firesprocess_project_url_ranking
for each of them. Note that each project will only belong to a single bucket.process_project_url_ranking
runs for a specific project. This is where the meat of the logic exists. We get the ranked list of urls collected from this project's event data and run it through various criteria to see whether we should attempt to monitor the urlThere are a fair few todos around that I need to finish up, as well as building the logic to send subscriptions to the topic for our rust consumer.