Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you configure a Sentry raven client in a development environment to not send exceptions and still work?

Tags:

We are running a Django server and using Sentry to capture exceptions. When we configure Sentry we add RAVEN_CONFIG our different settings.py files:

INSTALLED_APPS = (     'raven.contrib.django.raven_compat' )  RAVEN_CONFIG = {     'dsn': 'https://*****@app.getsentry.com/PORT_NUMBER', } 

We read here that we can just use an empty string DSN property. Though when we run python manage.py raven test as depicted here we get:

raven.exceptions.InvalidDsn: Unsupported Sentry DSN scheme:  () 

The best solution would be that we could always use a Raven client and the settings file would define whether exceptions are sent or not.

Another requirement is that we would like to use the Client module and capture exceptions. For this we have to set some DSN value:

from raven import Client client = Client('https://<key>:<secret>@app.getsentry.com/<project>') 

So not setting a DSN value isn't possible

like image 363
Agam Rafaeli Avatar asked Mar 09 '16 10:03

Agam Rafaeli


People also ask

What is Sentry configuration?

Sentry has various configuration options to help enhance the SDK functionality. The options can help provide additional data needed to debug issues even faster or help control what is sent to Sentry by filtering. Learn more in Configuration.


1 Answers

We read here that we can just use an empty string DSN property.

You should not be setting DSN to an empty string, but instead in your development settings configuration don't specify the DSN setting in the first place:

RAVEN_CONFIG = {} 
like image 95
alecxe Avatar answered Sep 17 '22 12:09

alecxe