Reading through the source of the raven, I saw that if you want to ignore some exceptions, you can add them to IGNORE_EXCEPTIONS as follows:
RAVEN_CONFIG = { 'dsn': '...', 'IGNORE_EXCEPTIONS': ['exceptions.ZeroDivisionError', 'some.other.module.CustomException'], ... }
Regarding the exclusion of certain modules / files, the best way would probably be to write your own client and decide whether or not to send the message to the sentry. He believes that you should override the send method, since it has all the data in a more accessible form.
You can do it as follows:
from raven.contrib.django.client import DjangoClient class MyClient(DjangoClient): def send(self, **kwargs): ''' check if culprit (event name) should be skipped ''' if kwargs.get('culprit', '').startswith('my.module.to.skip'): self.logger.info('Skipping entry') else: return super(MyClient, self).send(**kwargs)
and then set your user client in settings.py :
SENTRY_CLIENT = 'path.to.module.MyClient'
If you want to implement more complex rules for ignoring, you should probably check what you can do with the data (kwargs).
slafs
source share