Merge pull request #4121 from alphagov/more-sentry-tweaks-180766893

Tweak Sentry config to work in development
This commit is contained in:
Ben Thorner
2022-01-05 12:37:12 +00:00
committed by GitHub

View File

@@ -8,16 +8,16 @@ from sentry_sdk.integrations import logging
from app import create_app
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integrations=[FlaskIntegration(), RedisIntegration()],
environment=os.environ['NOTIFY_ENVIRONMENT'],
attach_stacktrace=True,
traces_sample_rate=0.00005 # avoid exceeding rate limits in Production
)
if 'SENTRY_DSN' in os.environ:
sentry_sdk.init(
dsn=os.environ['SENTRY_DSN'],
integrations=[FlaskIntegration(), RedisIntegration()],
environment=os.environ['NOTIFY_ENVIRONMENT'],
attach_stacktrace=True,
traces_sample_rate=0.00005 # avoid exceeding rate limits in Production
)
sentry_sdk.set_level('error') # only record error logs or exceptions
logging.ignore_logger('notifications_python_client.*') # ignore logs about 404s, etc.
logging.ignore_logger('notifications_python_client.*') # ignore logs about 404s, etc.
application = Flask('app')