aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Nanis2026-09-13 12:30:01 -0700
committerMax Nanis2026-09-13 12:30:01 -0700
commit9f0953031cf69a854e880a58a4839a9f7b1dd5b3 (patch)
tree52ffb0ecaf97ec492d1a5e0e724b8580361fd0dc
parent8fbe8d439b418796932aaa88297e006c714e4d13 (diff)
downloadamt-jb-9f0953031cf69a854e880a58a4839a9f7b1dd5b3.tar.gz
amt-jb-9f0953031cf69a854e880a58a4839a9f7b1dd5b3.zip
adding sentry
-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,
+ )