GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(huey): Add an option to monitor Huey periodic tasks by wedamija · Pull Request #8052 · getsentry/sentry-python Conversation
|
Coverage Results 📊✅ 134017 passed | ⏭️ 7311 skipped | Total: 141328 | Pass Rate: 94.83% | Execution Time: 435m 22s 📊 Comparison with Base Branch
➖ Removed Tests (58)View removed tests
All tests are passing successfully. ✅ Patch coverage is 96.43% (54 of 56 changed executable lines covered; target 80%). Changed files with executable lines (1)
Coverage diff@@ Coverage Diff @@ ## master #8052 +/-## ========================================== + Coverage 90.25% 90.28% +0.03% ========================================== Files 202 202 — Tracked lines 26660 26793 +133 Branches 9926 9994 +68 ========================================== + Hits 24062 24189 +127 - Misses 2598 2604 +6 - Partials 1510 1516 +6 Generated by Coverage Action |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| _CRONTAB_CODE = crontab().__code__ | ||
|
|
||
|
|
||
| def _get_closure_var(func: "Any", name: str) -> "Any": |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Constructing the monitor from code inspection like this feels brittle. Is there any other way we can get to it, e.g. by monkeypatching something (the crontab func maybe? haven't looked into it so don't know if feasible)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I looked into this with Claude for a while and it seems like it's pretty hard to do this via monkeypatching.
Huey doesn't have a public schedule object. crontab() keeps the parsed values in a closure and returns a plain timestamp -> bool function. Since most users import crontab before sentry_sdk.init(), any module where it's imported will have the original instead of the monkeypatched one.
It's definitely brittle if they change these internals. If they do, we will catch this in ci within a week since we bump to the latest Huey on a weekly basis.
I'm open to other options though if you have any thoughts on how to make this better
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking, I also briefly looked into it but didn't find a better way. Let's go with this then, and we'll monitor in the test matrix in CI.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
`RetryTask`, `TaskLockedException` and `CancelExecution` aren't failures for Huey or for the integration's error capture, so they no longer mark the check-in as an error. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
Match the Celery beat integration: skip periodic tasks whose schedule can't be expressed as a Sentry Crons monitor config instead of sending check-ins without one. Co-Authored-By: Claude <[email protected]>
Match Celery, which marks a retried beat task's check-in as an error. Co-Authored-By: Claude <[email protected]>
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Part of a series adding automatic Crons monitoring for the most-used job schedulers in each SDK. Check-ins for a monitor that doesn't exist yet are dropped, so today each monitor has to be created by hand with its schedule copied from the code. Sending the job's schedule as the monitor config lets Sentry create the monitor and keep it in sync. This is a quick fix to keep the arq integration behaviour in line with how other integrations work. Sorry for the churn! Follow-up to #8051. Cron jobs whose schedule Crons can't express are no longer monitored, instead of checking in without a config. This matches Celery beat, and the Huey and RQ integrations from #8052 and #8053. Docs: getsentry/sentry-docs#20056 Co-authored-by: Claude <[email protected]>
## DESCRIBE YOUR PR Adds a Huey section to the Python Crons setup page: turning on `monitor_periodic_tasks`, how the slug is picked, and which periodic tasks are monitored. SDK PR: getsentry/sentry-python#8052 Stacked on #20056. Merge after the SDK release that includes it. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Ivana Kellyer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.