Repository: mozilla/kitsune

Issue:
 Upgrade to new Sentry SDK 
Sentry dropped raven package in favor of a new unified SDK.

 - New Package: https://github.com/getsentry/sentry-python
 - Docs: https://docs.sentry.io/quickstart/?platform=python

While I couldn't find a deprecation schedule, please plan to upgrade to the new SDK in the near future to avoid incompatibility issues with the server.


Discussion:

Resolving patch:
diff --git a/kitsune/log_settings.py b/kitsune/log_settings.py
--- a/kitsune/log_settings.py
+++ b/kitsune/log_settings.py
@@ -7,10 +7,6 @@
 config = {
     'version': 1,
     'disable_existing_loggers': True,
-    'root': {
-        'level': logging.ERROR,
-        'handlers': ['sentry'],
-    },
     'formatters': {
         'default': {
             'format': '{0}: %(asctime)s %(name)s:%(levelname)s %(message)s: '
@@ -28,10 +24,6 @@
             'class': 'django.utils.log.AdminEmailHandler',
             'level': logging.ERROR,
         },
-        'sentry': {
-            'class': 'raven.contrib.django.handlers.SentryHandler',
-            'level': logging.ERROR,
-        },
         'console': {
             'class': 'logging.StreamHandler',
             'formatter': 'default',
@@ -54,16 +46,6 @@
             'propogate': True,
             'level': settings.LOG_LEVEL,
         },
-        'raven': {
-            'level': logging.ERROR,
-            'handlers': ['console', 'mail_admins'],
-            'propagate': False,
-        },
-        'sentry.errors': {
-            'level': logging.ERROR,
-            'handlers': ['console', 'mail_admins'],
-            'propagate': False,
-        },
     },
 }
 
diff --git a/kitsune/settings.py b/kitsune/settings.py
--- a/kitsune/settings.py
+++ b/kitsune/settings.py
@@ -668,9 +668,6 @@ def parse_conn_max_age(value):
     'watchman',
     # 'axes',
 
-    # App for Sentry:
-    'raven.contrib.django',
-
     # Extra apps for testing.
     'django_nose',
 
@@ -1102,14 +1099,17 @@ def JINJA_CONFIG():
 STATSD_PREFIX = config('STATSD_PREFIX', default='')
 
 
-RAVEN_CONFIG = {
-    'dsn': config('SENTRY_DSN', default=None),
-    'release': config('GIT_SHA', default=None),
-    'tags': {
-        'server_full_name': PLATFORM_NAME,
-        'environment': config('SENTRY_ENVIRONMENT', default=''),
-    }
-}
+if config('SENTRY_DSN', None):
+    import sentry_sdk
+    from sentry_sdk.integrations.django import DjangoIntegration
+
+    sentry_sdk.init(
+        dsn=config('SENTRY_DSN'),
+        integrations=[DjangoIntegration()],
+        release=config('GIT_SHA', default=None),
+        server_name=PLATFORM_NAME,
+        environment=config('SENTRY_ENVIRONMENT', default=''),
+    )
 
 
 PIPELINE_ENABLED = config('PIPELINE_ENABLED', default=False, cast=bool)
diff --git a/wsgi/app.py b/wsgi/app.py
--- a/wsgi/app.py
+++ b/wsgi/app.py
@@ -19,10 +19,6 @@
 
 application = get_wsgi_application()
 
-if config('SENTRY_DSN', None):
-    from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
-    application = Sentry(application)
-
 if config('ENABLE_WHITENOISE', default=False, cast=bool):
     from whitenoise.django import DjangoWhiteNoise
     application = DjangoWhiteNoise(application)


Test patch: