-
Notifications
You must be signed in to change notification settings - Fork 39
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
Stop logging proxied 5XX Graphite errors #3260
base: master
Are you sure you want to change the base?
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 9 files 9 suites 8m 11s ⏱️ Results for commit 20aa215. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3260 +/- ##
==========================================
+ Coverage 60.58% 60.64% +0.06%
==========================================
Files 606 606
Lines 43733 43735 +2
Branches 48 48
==========================================
+ Hits 26494 26522 +28
+ Misses 17227 17201 -26
Partials 12 12 ☔ View full report in Codecov by Sentry. |
This adds a bit of complicated regression testing of #3259, which causes Dango to send error e-mail to NAV site admins when the proxied response code from Graphite-web is in the 5XX range.
This adds what amounts to a dirty hack to the graphite-web proxy view (i.e. it reaches into Django internals) to prevent Django from doing a full error response log when proxying 5xx class errors from graphite-web. It does so by tricking `django.utils.log.log_response()` into thinking that the response has already been logged (since our view function has no other control over how its return values are logged by Django). The reason for the 5xx response codes are not bugs in our view code, and does not need to trigger site admin e-mails.
f847310
to
20aa215
Compare
Quality Gate passedIssues Measures |
This adds what amounts to a dirty hack to the graphite-web proxy view (i.e. it reaches into Django internals) to prevent Django from doing a full error response log when proxying 5xx class errors from graphite-web. It does so by tricking
django.utils.log.log_response()
into thinking that the response has already been logged (since our view function has no other control over how its return values are logged by Django).The reason for the 5xx response codes are not bugs in our view code, and does not need to trigger site admin e-mails.
Adds regression tests and fixes #3259