install sentry

This commit is contained in:
Aarni Halinen
2021-11-11 23:28:00 +02:00
parent 912ce44513
commit a4e1aa5032
3 changed files with 96 additions and 56 deletions
+18
View File
@@ -11,8 +11,26 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sikweb.base import *
# Setup sentry
sentry_sdk.init(
dsn=os.getenv("SENTRY_DSN", ""),
environment=os.getenv("DEPLOY_ENV", "production"),
integrations=[DjangoIntegration()],
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0,
# If you wish to associate users to errors (assuming you are using
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True
)
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv('DEBUG', False) == 'True'