Don't use post_init signal for initialize tracker#556
Don't use post_init signal for initialize tracker#556foarsitter merged 2 commits intojazzband:masterfrom
post_init signal for initialize tracker#556Conversation
| 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.
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_initsignal 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_initsignal for initialize trackerCommandments
CHANGES.rstfile to describe the changes, and quote according issue withGH-<issue_number>.