Repository navigation
feat: report all warnings to sentry - #26796
Merged
Merged
Conversation
Merged
untitaker
approved these changes
Jun 23, 2021
| # and capture_message is very limited, so we just log an error here since LOGGING setting | ||
| # is already configured to send error logs to the SDK's EventHandler. | ||
| def _showwarning(message, category, filename, lineno, file=None, line=None): | ||
| _warning_logger.error( |
Member
There was a problem hiding this comment.
woudl wrap this in safe_execute and also call the previous value of warnings.showwarning
Member
There was a problem hiding this comment.
ok, no safe_execute necessary I guess
would still call the old showwarning here
This was referenced Jun 23, 2021
This was referenced Jun 25, 2021
joshuarli
marked this pull request as ready for review
June 25, 2021 22:28
Member
Author
|
Ok at this point, pretty much this is good to merge once #26900 gets in. |
joshuarli
added a commit
that referenced
this pull request
Jun 29, 2021
This reverts commit d9de3cf.
joshuarli
added a commit
that referenced
this pull request
Jun 29, 2021
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'd like to start reporting all warnings to Sentry because I feel like there might be a few django deprecation warnings and other things that sneak past the test suite. Also, Django 2.0+ removes more and more of their py2/3 bytes/unicode compat code which we may have been relying on, I would like to also enable
-band seeBytesWarningreported to Sentry for some proactive fixes. The method is described in the comments next to_showwarning, h/t to @untitaker for helping me out here.The default warning behavior is to "print the first occurrence of matching warnings for each location (module + line number) where the warning is issued", so I don't think we'll get blasted with events, but they will slowly and continuously trickle in since we've got a lot of Sentry python processes and there are new ones all the time from k8s.
It will be a little annoying as they'll keep popping up each release, I intend to actively be ignoring warnings for a little while. Also TODO I can proactively discover these warnings from reading k8s logs and come up with a good ignore list before landing this.
TODO:
-band fixBytesWarnings (enabled now, but not seeing any, may show up very infrequently)