aboutsummaryrefslogtreecommitdiff
path: root/jb/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'jb/config.py')
-rw-r--r--jb/config.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/jb/config.py b/jb/config.py
index 7993f53..954dfe8 100644
--- a/jb/config.py
+++ b/jb/config.py
@@ -24,3 +24,22 @@ JB_EVENTS_STREAM = "amt_jb_events"
CONSUMER_GROUP = "amt-jb-0"
# We'll only have 1 consumer atm, change this if we don't
CONSUMER_NAME = "amt-jb-0"
+
+if settings.sentry:
+ import sentry_sdk
+ from sentry_sdk.integrations.fastapi import FastApiIntegration
+ from sentry_sdk.integrations.logging import LoggingIntegration
+ from sentry_sdk.integrations.redis import RedisIntegration
+
+ # --- Sentry Configuration ---
+ sentry_logging = LoggingIntegration(
+ level=logging.INFO, # Capture info and above as breadcrumbs
+ event_level=logging.ERROR, # Send errors as events
+ )
+ sentry_sdk.init(
+ dsn=str(settings.sentry),
+ integrations=[FastApiIntegration(), sentry_logging, RedisIntegration()],
+ send_default_pii=True,
+ sample_rate=1,
+ traces_sample_rate=0.1,
+ )