Skip to content

Commit

Permalink
Integrate sentry into the django project
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed May 22, 2024
1 parent 47ddc04 commit 041ee6d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dockerize/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ DEFAULT_PLUGINS_SITE='https://plugins.qgis.org/'
QGISPLUGINS_ENV=debug

# Ldap
ENABLE_LDAP=True
ENABLE_LDAP=True

# SENTRY
SENTRY_DSN=''
1 change: 1 addition & 0 deletions dockerize/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion dockerize/docker/REQUIREMENTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ django-preferences==1.0.0
PyWavefront==1.3.3
django-matomo==0.1.6
uwsgi~=2.0
freezegun~=1.4
freezegun~=1.4

sentry-sdk~=2.2
15 changes: 14 additions & 1 deletion qgis-app/settings_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,17 @@
MATOMO_URL="//matomo.qgis.org/"

# Default primary key type
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
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,
)

0 comments on commit 041ee6d

Please sign in to comment.