-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use correct signatures for Celery Task Hooks #791
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #791 +/- ##
=======================================
Coverage 98.01% 98.01%
=======================================
Files 442 443 +1
Lines 36597 36533 -64
=======================================
- Hits 35869 35808 -61
+ Misses 728 725 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #791 +/- ##
=======================================
Coverage 98.01% 98.01%
=======================================
Files 442 443 +1
Lines 36597 36533 -64
=======================================
- Hits 35869 35808 -61
+ Misses 728 725 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #791 +/- ##
=======================================
Coverage 98.01% 98.01%
=======================================
Files 442 443 +1
Lines 36597 36533 -64
=======================================
- Hits 35869 35808 -61
+ Misses 728 725 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #791 +/- ##
=======================================
Coverage 98.01% 98.01%
=======================================
Files 442 443 +1
Lines 36597 36533 -64
=======================================
- Hits 35869 35808 -61
+ Misses 728 725 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
7844c7a
to
4d077e4
Compare
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.
did you observe that this behaves differently? it's a little surprising to me
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.
self.metrics_prefix
might also be dead code now too
EDIT nvm it's referenced in task subclasses still
4d077e4
to
18698bb
Compare
This explicitly declares and forwards all the arguments to the `on_success/retry/failure` task hooks, as they are documented on https://docs.celeryq.dev/en/main/_modules/celery/app/task.html#Task.on_success The reason being that the Sentry tags set via the `MetricContext` constructor are not making their way to Sentry, possibly because the `kwargs` were misused in the previous hooks, and were overwriting those tag values with `None`. So this should ideally solve that mystery. As a driveby change, I also took the liberty of removing all the deprecated statsd `metrics` calls. All of the relevant metrics also have prometheus equivalents.
18698bb
to
8c66f91
Compare
This explicitly declares and forwards all the arguments to the
on_success/retry/failure
task hooks, as they are documented on https://docs.celeryq.dev/en/main/_modules/celery/app/task.html#Task.on_successThe reason being that the Sentry tags set via the
MetricContext
constructor are not making their way to Sentry, possibly because thekwargs
were misused in the previous hooks, and were overwriting those tag values withNone
.So this should ideally solve that mystery.
As a driveby change, I also took the liberty of removing all the deprecated statsd
metrics
calls. All of the relevant metrics also have prometheus equivalents.