1
0
Fork 0

Replace raven with sentry-sdk

merge-requests/714/head
Pierros Papadeas 2019-03-04 14:06:42 +02:00
parent b54dc61901
commit 9746c85bb0
No known key found for this signature in database
GPG Key ID: 8DB97129D9982991
5 changed files with 36 additions and 63 deletions

View File

@ -10,3 +10,7 @@
# Mapbox # Mapbox
# MAPBOX_TOKEN=enter_mapbox_token_here # MAPBOX_TOKEN=enter_mapbox_token_here
# Sentry
# SENTRY_ENABLED=False
# SENTRY_DSN='sentry_dsn'

View File

@ -1,8 +1,8 @@
from decouple import config, Csv from decouple import config, Csv
from dj_database_url import parse as db_url from dj_database_url import parse as db_url
from unipath import Path from unipath import Path
import os import sentry_sdk
import raven from sentry_sdk.integrations.django import DjangoIntegration
ROOT = Path(__file__).parent ROOT = Path(__file__).parent
@ -33,7 +33,6 @@ THIRD_PARTY_APPS = (
'allauth.socialaccount', 'allauth.socialaccount',
'compressor', 'compressor',
'csp', 'csp',
'raven.contrib.django.raven_compat',
) )
LOCAL_APPS = ( LOCAL_APPS = (
'network.users', 'network.users',
@ -191,11 +190,7 @@ AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
# Logging # Logging
LOGGING = { LOGGING = {
'version': 1, 'version': 1,
'disable_existing_loggers': True, 'disable_existing_loggers': False,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': { 'formatters': {
'verbose': { 'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s - %(process)d %(thread)d - %(message)s' 'format': '%(levelname)s %(asctime)s %(module)s - %(process)d %(thread)d - %(message)s'
@ -207,11 +202,6 @@ LOGGING = {
} }
}, },
'handlers': { 'handlers': {
'sentry': {
'level': 'ERROR',
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
'tags': {'custom-tag': 'x'},
},
'console': { 'console': {
'level': 'DEBUG', 'level': 'DEBUG',
'class': 'logging.StreamHandler', 'class': 'logging.StreamHandler',
@ -220,9 +210,9 @@ LOGGING = {
}, },
'loggers': { 'loggers': {
'django.request': { 'django.request': {
'handlers': ['console'],
'level': 'ERROR', 'level': 'ERROR',
'propagate': True, 'handlers': ['console'],
'propagate': False,
}, },
'django.network.backends': { 'django.network.backends': {
'level': 'ERROR', 'level': 'ERROR',
@ -234,33 +224,16 @@ LOGGING = {
'handlers': ['console'], 'handlers': ['console'],
'propagate': False, 'propagate': False,
}, },
'django.db.backends': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
} }
} }
# Raven - Sentry # Sentry
RAVEN_ENABLED = config('RAVEN_ENABLED', default=False) SENTRY_ENABLED = config('SENTRY_ENABLED', default=False, cast=bool)
if RAVEN_ENABLED: if SENTRY_ENABLED:
RAVEN_CONFIG = { sentry_sdk.init(
'dsn': config('RAVEN_DSN', default=''), dsn=config('SENTRY_DSN', default=''),
'release': raven.fetch_git_sha(os.path.abspath(os.curdir)), integrations=[DjangoIntegration()]
} )
else:
RAVEN_CONFIG = {}
# Celery # Celery
CELERY_ENABLE_UTC = USE_TZ CELERY_ENABLE_UTC = USE_TZ

View File

@ -5,10 +5,9 @@
-r requirements.txt -r requirements.txt
apipkg==1.5 apipkg==1.5
atomicwrites==1.2.1 atomicwrites==1.3.0
attrs==18.2.0 attrs==19.1.0
coverage==4.5.2 coverage==4.5.2
docopts==0.6.1
execnet==1.5.0 execnet==1.5.0
factory-boy==2.11.1 factory-boy==2.11.1
Faker==0.8.18 Faker==0.8.18
@ -17,15 +16,15 @@ ipaddress==1.0.22
mock==2.0.0 mock==2.0.0
more-itertools==5.0.0 more-itertools==5.0.0
pathlib2==2.3.3 pathlib2==2.3.3
pbr==5.1.1 pbr==5.1.3
pluggy==0.8.1 pluggy==0.9.0
pur==5.2.1 pur==5.2.1
py==1.7.0 py==1.8.0
pytest==4.1.1 pytest==4.3.0
pytest-cov==2.6.1 pytest-cov==2.6.1
pytest-django==3.4.5 pytest-django==3.4.8
pytest-forked==0.2 pytest-forked==0.2
pytest-xdist==1.25.0 pytest-xdist==1.25.0
python-dateutil==2.7.5 python-dateutil==2.8.0
scandir==1.9.0 scandir==1.9.0
text-unidecode==1.2 text-unidecode==1.2

View File

@ -3,7 +3,7 @@
# Please edit 'setup.cfg' to add top-level dependencies and use # Please edit 'setup.cfg' to add top-level dependencies and use
# './contrib/refresh-requirements.sh to regenerate this file # './contrib/refresh-requirements.sh to regenerate this file
amqp==2.4.0 amqp==2.4.2
args==0.1.0 args==0.1.0
backports.csv==1.0.6 backports.csv==1.0.6
billiard==3.5.0.5 billiard==3.5.0.5
@ -14,10 +14,10 @@ Click==7.0
clint==0.5.1 clint==0.5.1
contextlib2==0.5.5 contextlib2==0.5.5
dj-database-url==0.5.0 dj-database-url==0.5.0
Django==1.11.18 Django==1.11.20
django-allauth==0.35.0 django-allauth==0.35.0
django-appconf==1.0.2 django-appconf==1.0.3
django-autoslug==1.9.3 django-autoslug==1.9.4
django-avatar==4.1.0 django-avatar==4.1.0
django-braces==1.12.0 django-braces==1.12.0
django-compressor==2.2 django-compressor==2.2
@ -28,17 +28,17 @@ django-jsonfield==1.0.1
django-redis-cache==1.7.1 django-redis-cache==1.7.1
django-shortuuidfield==0.1.3 django-shortuuidfield==0.1.3
djangorestframework==3.7.7 djangorestframework==3.7.7
docopt==0.6.1 docopt==0.6.2
gunicorn==19.7.1 gunicorn==19.7.1
idna==2.8 idna==2.8
internetarchive==1.7.7 internetarchive==1.7.7
jsonpatch==1.23 jsonpatch==1.23
jsonpointer==2.0 jsonpointer==2.0
kombu==4.2.2.post1 kombu==4.4.0
lxml==4.3.0 lxml==4.3.2
Markdown==2.6.11 Markdown==2.6.11
mysqlclient==1.3.14 mysqlclient==1.3.14
oauthlib==3.0.0 oauthlib==3.0.1
orbit@git+https://gitlab.com/librespacefoundation/orbit.git@db463c2d261365485c157f2c86233aaf44e577a2 orbit@git+https://gitlab.com/librespacefoundation/orbit.git@db463c2d261365485c157f2c86233aaf44e577a2
Pillow==5.0.0 Pillow==5.0.0
pyephem==3.7.6.0 pyephem==3.7.6.0
@ -47,19 +47,18 @@ python-decouple==3.1
python-dotenv==0.6.5 python-dotenv==0.6.5
python-openid==2.2.5 python-openid==2.2.5
pytz==2018.9 pytz==2018.9
raven==6.9.0
rcssmin==1.0.6 rcssmin==1.0.6
redis==2.10.6 redis==2.10.6
requests==2.21.0 requests==2.21.0
requests-cache==0.4.13 requests-cache==0.4.13
requests-oauthlib==1.2.0 requests-oauthlib==1.2.0
rjsmin==1.0.12 rjsmin==1.0.12
schema==0.6.8 schema==0.7.0
sentry-sdk==0.6.9 sentry-sdk==0.7.4
shortuuid==0.5.0 shortuuid==0.5.0
six==1.12.0 six==1.12.0
social-auth-app-django==1.2.0 social-auth-app-django==1.2.0
social-auth-core==3.0.0 social-auth-core==3.1.0
unicode-slugify==0.1.3 unicode-slugify==0.1.3
Unidecode==1.0.23 Unidecode==1.0.23
Unipath==1.1 Unipath==1.1

View File

@ -36,8 +36,7 @@ install_requires =
django-redis-cache~=1.7.0 django-redis-cache~=1.7.0
redis<3 redis<3
# Logging # Logging
raven~=6.9.0 sentry-sdk~=0.7.0
sentry-sdk~=0.6.0
# Configuration # Configuration
unicode-slugify~=0.1.0 unicode-slugify~=0.1.0
django-autoslug~=1.9.0 django-autoslug~=1.9.0
@ -74,7 +73,6 @@ dev =
Faker~=0.8.0 Faker~=0.8.0
factory-boy~=2.11.0 factory-boy~=2.11.0
pur~=5.2.0 pur~=5.2.0
docopts~=0.6.0
[flake8] [flake8]
max-complexity = 25 max-complexity = 25