From eebdf5c235c51d3510906187e93317b18385c9c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Tue, 15 Oct 2019 21:01:16 +0200 Subject: [PATCH] Add Celery integration to Sentry https://docs.sentry.io/platforms/python/celery/ --- mygpo/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mygpo/settings.py b/mygpo/settings.py index d45137cb..00ae5779 100644 --- a/mygpo/settings.py +++ b/mygpo/settings.py @@ -375,13 +375,16 @@ SEARCH_CUTOFF = float(os.getenv('SEARCH_CUTOFF', 0.3)) try: import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration + from sentry_sdk.integrations.celery import CeleryIntegration # Sentry Data Source Name (DSN) sentry_dsn = os.getenv('SENTRY_DSN', '') if not sentry_dsn: raise ValueError('Could not set up sentry because ' 'SENTRY_DSN is not set') - sentry_sdk.init(dsn=sentry_dsn, integrations=[DjangoIntegration()]) + sentry_sdk.init( + dsn=sentry_dsn, integrations=[DjangoIntegration(), CeleryIntegration()] + ) except (ImportError, ValueError): pass -- 2.11.4.GIT