Browse Source

Add Sentry.IO logging

master
Joshua Rubingh 1 year ago
parent
commit
ca23314b67
  1. 4
      VRE/VRE/.env.example
  2. 19
      VRE/VRE/settings.py
  3. 3
      VRE/requirements.txt

4
VRE/VRE/.env.example

@ -74,3 +74,7 @@ DROPOFF_UPLOAD_HOST=http://localhost:1090 @@ -74,3 +74,7 @@ DROPOFF_UPLOAD_HOST=http://localhost:1090
# Which file extensions are **NOT** allowed to be uploaded. By default the extensions exe,com,bat,lnk,sh are not allowed
DROPOFF_NOT_ALLOWED_EXTENSIONS=exe,com,bat,lnk,sh
# Sentry settings
# Enter the full Sentry DSN string. This should contain a key and a project
SENTRY_DSN=

19
VRE/VRE/settings.py

@ -16,6 +16,25 @@ from decouple import config, Csv @@ -16,6 +16,25 @@ from decouple import config, Csv
from dj_database_url import parse as db_url
from django.utils.translation import ugettext_lazy as _
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
SENTRY_DSN = config('SENTRY_DSN', None)
if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
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
)
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

3
VRE/requirements.txt

@ -25,4 +25,5 @@ PyGithub==1.54.1 @@ -25,4 +25,5 @@ PyGithub==1.54.1
python-irodsclient==0.8.6
django-extensions==3.1.3
pygraphviz==1.7
django-debug-toolbar==3.2.1
django-debug-toolbar==3.2.1
sentry-sdk==1.4.3
Loading…
Cancel
Save