summaryrefslogtreecommitdiff
path: root/rq/contrib/sentry.py
blob: edf0fe419a93616157e0453d9fb6def77fa510cd (plain)
1
2
3
4
5
6
7
def register_sentry(sentry_dsn, **opts):
    """Given a Raven client and an RQ worker, registers exception handlers
    with the worker so exceptions are logged to Sentry.
    """
    import sentry_sdk
    from sentry_sdk.integrations.rq import RqIntegration
    sentry_sdk.init(sentry_dsn, integrations=[RqIntegration()], **opts)