diff options
| author | Max Nanis | 2026-09-13 12:30:01 -0700 |
|---|---|---|
| committer | Max Nanis | 2026-09-13 12:30:01 -0700 |
| commit | 9f0953031cf69a854e880a58a4839a9f7b1dd5b3 (patch) | |
| tree | 52ffb0ecaf97ec492d1a5e0e724b8580361fd0dc | |
| parent | 8fbe8d439b418796932aaa88297e006c714e4d13 (diff) | |
| download | amt-jb-9f0953031cf69a854e880a58a4839a9f7b1dd5b3.tar.gz amt-jb-9f0953031cf69a854e880a58a4839a9f7b1dd5b3.zip | |
adding sentry
| -rw-r--r-- | jb/config.py | 19 |
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, + ) |
