Skip to content
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

Ignore specific loggers in sentry. #3485

Merged
merged 1 commit into from
Mar 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions kitsune/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,11 +1105,9 @@ def JINJA_CONFIG():

# see https://docs.sentry.io/learn/filtering/?platform=python
def filter_exceptions(event, hint):
from django.security import DisallowedHost
if 'exc_info' in hint:
exc_type, exc_value, tb = hint['exc_info']
if isinstance(exc_value, DisallowedHost):
return None
# Ignore errors from specific loggers.
if event.get('logger', '') == 'django.security.DisallowedHost':
return None

return event

Expand Down
5 changes: 3 additions & 2 deletions requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -480,5 +480,6 @@ chardet==3.0.2 \
certifi==2017.4.17 \
--hash=sha256:f4318671072f030a33c7ca6acaef720ddd50ff124d1388e50c1bda4cbd6d7010 \
--hash=sha256:f7527ebf7461582ce95f7a9e03dd141ce810d40590834f4ec20cddd54234c10a
sentry-sdk==0.5.1 \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version caused my local env to produce a 500 error

--hash=sha256:c18552010648e6303b557310dc6e4babda3c942c6e4145995699547c64d3982f
sentry-sdk==0.7.6 \
--hash=sha256:dc207c083604bae01761866b3145ca9dcf5a45f3de048c4da22eac88889d49e7 \
--hash=sha256:f94cca2eb41d29fd2bdbedaf9d9a262ab3b4660e5d648d9920fae262e240c368