-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Don't use post_init
signal for initialize tracker
#556
Conversation
@@ -340,7 +340,7 @@ def finalize_class(self, sender, **kwargs): | |||
wrapped_descriptor = wrapper_cls(field_name, descriptor, self.attname) | |||
setattr(sender, field_name, wrapped_descriptor) | |||
self.field_map = self.get_field_map(sender) | |||
models.signals.post_init.connect(self.initialize_tracker) | |||
self.patch_init(sender) | |||
self.model_class = sender |
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.
We could safely remove this property model_class
since not using signal anymore, refer to 98f078d
@meanmail Thank you for the PR, I'm experiencing the same issue as yours. |
If you can test this change in production it would be helpful. |
For anyone else who looks into this – in the meantime you might be interested in getsentry/sentry-python#1929 |
We've been using this change in production for over a year now. There were no problems |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #556 +/- ##
==========================================
- Coverage 95.10% 95.01% -0.09%
==========================================
Files 6 6
Lines 796 803 +7
==========================================
+ Hits 757 763 +6
- Misses 39 40 +1 ☔ View full report in Codecov by Sentry. |
@meanmail then it is time to merge it! |
Is there a timeline for this being ready to use? |
@mga226 it is a jazzband project so feel free to contribute. |
Problem
In one of the latest versions, sentry-sdk added logging of the launch of django signal handlers. Due to the fact that the
post_init
signal handler is used to initialize the tracker, this leads to a significant decrease in performance, and also occupies the sentry logs with useless entries, which makes it impossible to analyze performance in SentrySolution
Don't use
post_init
signal for initialize trackerCommandments
CHANGES.rst
file to describe the changes, and quote according issue withGH-<issue_number>
.