From 9f0953031cf69a854e880a58a4839a9f7b1dd5b3 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Sun, 13 Sep 2026 12:30:01 -0700 Subject: adding sentry --- jb/config.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'jb') 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, + ) -- cgit v1.2.3