Skip to content

Commit

Permalink
Replace Raven with new Sentry SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasLM committed Jun 10, 2019
1 parent caa3238 commit 144d3a3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
25 changes: 17 additions & 8 deletions feedsubs/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
# - Add all standard security headers to responses

INSTALLED_APPS += [
'raven.contrib.django',
'ddtrace.contrib.django',
'waitressd.apps.WaitressdConfig'
]
MIDDLEWARE = (
['waitressd.middleware.access_log'] +
['whitenoise.middleware.WhiteNoiseMiddleware'] +
MIDDLEWARE +
['raven.contrib.django.middleware.SentryResponseErrorIdMiddleware']
MIDDLEWARE
)

STATIC_ROOT = '/opt/static'
Expand All @@ -48,11 +46,6 @@
EMAIL_USE_TLS = True
EMAIL_TIMEOUT = 120

RAVEN_CONFIG = {
'dsn': config('SENTRY_DSN'),
'release': pkg_resources.require("feedsubs")[0].version,
}

CACHES = {
'default': {
'TIMEOUT': 24 * 60 * 60, # keys expire by default after 1 day
Expand Down Expand Up @@ -97,3 +90,19 @@
'AGENT_HOSTNAME': config('DD_AGENT_HOSTNAME', default='localhost'),
'AGENT_PORT': config('DD_AGENT_PORT', 8126, cast=int),
}


import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from spinach.contrib.sentry_sdk_spinach import SpinachIntegration

sentry_sdk.init(
dsn=config('SENTRY_DSN'),
environment='prod',
release=pkg_resources.require("feedsubs")[0].version,
send_default_pii=True,
integrations=[
DjangoIntegration(),
SpinachIntegration()
]
)
15 changes: 6 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ attrs==19.1.0
beautifulsoup4==4.7.1
bleach==3.1.0
blinker==1.4
boto3==1.9.161
botocore==1.12.161
boto3==1.9.164
botocore==1.12.164
certifi==2019.3.9
chardet==3.0.4
ddtrace==0.25.0
ddtrace==0.26.0
defusedxml==0.6.0
Django==2.2.2
django-allauth==0.39.1
django-bulma==0.5.6
django-redis==4.10.0
django-storages==1.7.1
docutils==0.14
html5lib==1.0.1
idna==2.8
jmespath==0.9.4
msgpack-python==0.5.6
oauthlib==3.0.1
Pillow==6.0.0
psutil==5.6.2
Expand All @@ -27,17 +25,16 @@ python-dateutil==2.8.0
python-decouple==3.1
python3-openid==3.1.0
pytz==2019.1
raven==6.10.0
redis==3.2.1
requests==2.22.0
requests-oauthlib==1.2.0
s3transfer==0.2.1
sentry-sdk==0.9.0
six==1.12.0
soupsieve==1.9.1
spinach==0.0.9
spinach==0.0.10
sqlparse==0.3.0
urllib3==1.25.2
urllib3==1.25.3
waitress==1.3.0
webencodings==0.5.1
whitenoise==4.1.2
wrapt==1.11.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
'django-storages',
'waitress',
'whitenoise',
'raven',
'sentry-sdk',
],
'dev': [
'django-debug-toolbar',
Expand Down

0 comments on commit 144d3a3

Please sign in to comment.