rq/patterns/sentry.md

1.4 KiB

title layout
RQ: Sending exceptions to Sentry patterns

Sending exceptions to Sentry

Sentry is a popular exception gathering service that RQ supports integrating with since version 0.3.1, through its custom exception handlers.

RQ includes a convenience function that registers your existing Sentry client to send all exceptions to.

An example:

{% highlight python %} from raven import Client from rq.contrib.sentry import register_sentry

client = Client('your sentry DSN here') register_sentry(client, worker) {% endhighlight %}

Where worker is your RQ worker instance. After that, call worker.work(...) to start the worker. All exceptions that occur are reported to Sentry automatically.

Note:

Error delivery to Sentry is known to be unreliable with RQ when using async transports (the default is). So you are encouraged to use the sync+https:// or requests+https:// versions of the Sentry DSN in RQ.

For more info, see the Raven docs.

Read more on RQ's custom exception handling capabilities.