Skip to content

Commit

Permalink
Enable Sentry in the RMQ Worker
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jun 5, 2024
1 parent 397acbb commit 1ed6307
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,16 @@ def __init__(
self.version = version
self.local_queue = Queue()
self.prefetch_count_mapping = prefetch_count_mapping
if settings.SENTRY_DSN:
import sentry_sdk

sentry_sdk.init(
dsn=settings.SENTRY_DSN,
traces_sample_rate=0,
release=settings.SENTRY_RELEASE,
environment=settings.SENTRY_ENVIRONMENT,
send_default_pii=False,
)

def on_signal(self, signal, _):
log.warning(f"Shutting down worker (signal {signal})")
Expand Down

0 comments on commit 1ed6307

Please sign in to comment.