From 4b4032be6f984cea34aeb7a52cbfcc38bc389b35 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Nov 2022 11:18:42 -0700 Subject: Add Sentry error integration option --- takahe/settings/production.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'takahe') diff --git a/takahe/settings/production.py b/takahe/settings/production.py index 34116af..4120217 100644 --- a/takahe/settings/production.py +++ b/takahe/settings/production.py @@ -77,3 +77,17 @@ STATOR_TOKEN = os.environ.get("TAKAHE_STATOR_TOKEN") # Error email recipients if "TAKAHE_ERROR_EMAILS" in os.environ: ADMINS = [("Admin", e) for e in os.environ["TAKAHE_ERROR_EMAILS"].split(",")] + +# Sentry integration +if "SENTRY_DSN" in os.environ: + import sentry_sdk + from sentry_sdk.integrations.django import DjangoIntegration + + sentry_sdk.init( + dsn=os.environ["SENTRY_DSN"], + integrations=[ + DjangoIntegration(), + ], + traces_sample_rate=1.0, + send_default_pii=True, + ) -- cgit v1.2.3