summaryrefslogtreecommitdiffstats
path: root/takahe
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-20 11:18:42 -0700
committerAndrew Godwin2022-11-20 11:18:55 -0700
commit4b4032be6f984cea34aeb7a52cbfcc38bc389b35 (patch)
tree1a26fdf489ff7ccfbbc2bcd7a3cd1c60daa9bc57 /takahe
parent75e73859688c8893edc2650d12b10e3005d9db76 (diff)
downloadtakahe-4b4032be6f984cea34aeb7a52cbfcc38bc389b35.tar.gz
takahe-4b4032be6f984cea34aeb7a52cbfcc38bc389b35.tar.bz2
takahe-4b4032be6f984cea34aeb7a52cbfcc38bc389b35.zip
Add Sentry error integration option
Diffstat (limited to 'takahe')
-rw-r--r--takahe/settings/production.py14
1 files changed, 14 insertions, 0 deletions
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,
+ )