diff --git a/dockerize/.env.template b/dockerize/.env.template index 43f8d6bb..ae22847d 100644 --- a/dockerize/.env.template +++ b/dockerize/.env.template @@ -31,4 +31,7 @@ DEFAULT_PLUGINS_SITE='https://plugins.qgis.org/' QGISPLUGINS_ENV=debug # Ldap -ENABLE_LDAP=True \ No newline at end of file +ENABLE_LDAP=True + +# SENTRY +SENTRY_DSN='' \ No newline at end of file diff --git a/dockerize/docker-compose.yml b/dockerize/docker-compose.yml index 225f9784..e6a17637 100644 --- a/dockerize/docker-compose.yml +++ b/dockerize/docker-compose.yml @@ -53,6 +53,7 @@ services: - EMAIL_HOST_USER=${EMAIL_HOST_USER:-automation} - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD} - DEFAULT_PLUGINS_SITE=${DEFAULT_PLUGINS_SITE:-https://plugins.qgis.org/} + - SENTRY_DSN=${SENTRY_DSN} volumes: - ../qgis-app:/home/web/django_project - ./docker/uwsgi.conf:/uwsgi.conf diff --git a/dockerize/docker/REQUIREMENTS.txt b/dockerize/docker/REQUIREMENTS.txt index e9ff83f3..fa09ac7f 100644 --- a/dockerize/docker/REQUIREMENTS.txt +++ b/dockerize/docker/REQUIREMENTS.txt @@ -58,4 +58,6 @@ django-preferences==1.0.0 PyWavefront==1.3.3 django-matomo==0.1.6 uwsgi~=2.0 -freezegun~=1.4 \ No newline at end of file +freezegun~=1.4 + +sentry-sdk~=2.2 \ No newline at end of file diff --git a/qgis-app/settings_docker.py b/qgis-app/settings_docker.py index c0b7be1e..23290d50 100644 --- a/qgis-app/settings_docker.py +++ b/qgis-app/settings_docker.py @@ -159,4 +159,17 @@ MATOMO_URL="//matomo.qgis.org/" # Default primary key type -DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' \ No newline at end of file +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + + +# Sentry +SENTRY_DSN = os.environ.get("SENTRY_DSN", "") + +import sentry_sdk + +sentry_sdk.init( + dsn=SENTRY_DSN, + # Set traces_sample_rate to 1.0 to capture 100% + # of transactions for performance monitoring. + traces_sample_rate=1.0, +)