Skip to content
Snippets Groups Projects
Commit 07ab1a18 authored by jan.bednarik's avatar jan.bednarik
Browse files

Sentry setup

parent 66ecf7cd
No related branches found
No related tags found
2 merge requests!35Sentry setup,!34Sentry setup
Pipeline #17014 passed
...@@ -25,3 +25,5 @@ rollbar==0.14.7 ...@@ -25,3 +25,5 @@ rollbar==0.14.7
requests-oauthlib==1.3.0 requests-oauthlib==1.3.0
unidecode==1.3.6 unidecode==1.3.6
sentry-sdk[django]==1.40.5
...@@ -5,6 +5,11 @@ import sys ...@@ -5,6 +5,11 @@ import sys
import json import json
import os import os
import sentry_sdk
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
TESTING = 'test' in sys.argv TESTING = 'test' in sys.argv
# go through environment variables and override them # go through environment variables and override them
...@@ -311,3 +316,16 @@ OCTOPUS_API_TOKEN = get_from_env('OCTOPUS_API_TOKEN', '') ...@@ -311,3 +316,16 @@ OCTOPUS_API_TOKEN = get_from_env('OCTOPUS_API_TOKEN', '')
if DEBUG: if DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# Sentry setup
SENTRY_DSN = get_from_env('SENTRY_DSN', '')
if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[
DjangoIntegration(),
CeleryIntegration(),
LoggingIntegration(level=logging.INFO, event_level=logging.WARNING),
],
send_default_pii=True,
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment