summaryrefslogtreecommitdiff
path: root/docs/patterns
diff options
context:
space:
mode:
authorSelwin Ong <selwin.ong@gmail.com>2019-03-30 09:13:56 +0700
committerGitHub <noreply@github.com>2019-03-30 09:13:56 +0700
commitc4cbb3af2ff7baad1cf4a2319b72324f966df77b (patch)
treeb6d3a6e8ed73bd2d37fcceb2346a13199bfbcab4 /docs/patterns
parentabf688111401edcd659234d18631462eb6b9442b (diff)
downloadrq-c4cbb3af2ff7baad1cf4a2319b72324f966df77b.tar.gz
RQ v1.0! (#1059)
* Added FailedJobRegistry. * Added job.failure_ttl. * queue.enqueue() now supports failure_ttl * Added registry.get_queue(). * FailedJobRegistry.add() now assigns DEFAULT_FAILURE_TTL. * StartedJobRegistry.cleanup() now moves expired jobs to FailedJobRegistry. * Failed jobs are now added to FailedJobRegistry. * Added FailedJobRegistry.requeue() * Document the new `FailedJobRegistry` and changes in custom exception handler behavior. * Added worker.disable_default_exception_handler. * Document --disable-default-exception-handler option. * Deleted worker.failed_queue. * Deleted "move_to_failed_queue" exception handler. * StartedJobRegistry should no longer move jobs to FailedQueue. * Deleted requeue_job * Fixed test error. * Make requeue cli command work with FailedJobRegistry * Added .pytest_cache to gitignore. * Custom exception handlers are no longer run in reverse * Restored requeue_job function * Removed get_failed_queue * Deleted FailedQueue * Updated changelog. * Document `failure_ttl` * Updated docs. * Remove job.status * Fixed typo in test_registry.py * Replaced _pipeline() with pipeline() * FailedJobRegistry no longer fails on redis-py>=3 * Fixes test_clean_registries * Worker names are now randomized * Added a note about random worker names in CHANGES.md * Worker will now stop working when encountering an unhandled exception. * Worker should reraise SystemExit on cold shutdowns * Added anchor.js to docs * Support for Sentry-SDK (#1045) * Updated RQ to support sentry-sdk * Document Sentry integration * Install sentry-sdk before running tests * Improved rq info CLI command to be more efficient when displaying lar… (#1046) * Improved rq info CLI command to be more efficient when displaying large number of workers * Fixed an rq info --by-queue bug * Fixed worker.total_working_time bug (#1047) * queue.enqueue() no longer accepts `timeout` argument (#1055) * Clean worker registry (#1056) * queue.enqueue() no longer accepts `timeout` argument * Added clean_worker_registry() * Show worker hostname and PID on cli (#1058) * Show worker hostname and PID on cli * Improve test coverage * Remove Redis version check when SSL is used * Bump version to 1.0 * Removed pytest_cache/README.md * Changed worker logging to use exc_info=True * Removed unused queue.dequeue() * Fixed typo in CHANGES.md * setup_loghandlers() should always call logger.setLevel() if specified
Diffstat (limited to 'docs/patterns')
-rw-r--r--docs/patterns/sentry.md86
1 files changed, 44 insertions, 42 deletions
diff --git a/docs/patterns/sentry.md b/docs/patterns/sentry.md
index ecce264..7dab4dc 100644
--- a/docs/patterns/sentry.md
+++ b/docs/patterns/sentry.md
@@ -3,45 +3,47 @@ title: "RQ: Sending exceptions to Sentry"
layout: patterns
---
-## Sending exceptions to Sentry
-
-[Sentry](https://www.getsentry.com/) 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 raven.transport.http import HTTPTransport
-from rq.contrib.sentry import register_sentry
-
-client = Client('<YOUR_DSN>', transport=HTTPTransport)
-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.
-
-<div class="warning" style="margin-top: 20px">
- <img style="float: right; margin-right: -60px; margin-top: -38px" src="{{site.baseurl}}img/warning.png" />
- <strong>Note:</strong>
- <p>
- 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
- <code>HTTPTransport</code> or <code>RequestsHTTPTransport</code> when
- creating your client. See the code sample above, or the <a
- href="http://raven.readthedocs.org/en/latest/transports/index.html">Raven
- documentation</a>.
- </p>
- <p>
- For more info, see the
- <a href="http://raven.readthedocs.org/en/latest/transports/index.html#transports">Raven docs</a>.
- </p>
-</div>
-
-Read more on RQ's [custom exception handling](/docs/exceptions/) capabilities.
+## Sending Exceptions to Sentry
+
+[Sentry](https://www.getsentry.com/) is a popular exception gathering service.
+RQ allows you to very easily send job exceptions to Sentry. To do this, you'll
+need to have [sentry-sdk](https://pypi.org/project/sentry-sdk/) installed.
+
+There are a few ways to start sending job exceptions to Sentry.
+
+
+### Configuring Sentry Through CLI
+
+Simply invoke the `rqworker` script using the ``--sentry-dsn`` argument.
+
+```console
+rq worker --sentry-dsn https://my-dsn@sentry.io/123
+```
+
+
+### Configuring Sentry Through a Config File
+
+Declare `SENTRY_DSN` in RQ's config file like this:
+
+```python
+SENTRY_DSN = 'https://my-dsn@sentry.io/123'
+```
+
+And run RQ's worker with your config file:
+
+```console
+rq worker -c my_settings
+```
+
+Visit [this page](https://python-rq.org/docs/workers/#using-a-config-file)
+to read more about running RQ using a config file.
+
+
+### Configuring Sentry Through Environment Variable
+
+Simple set `RQ_SENTRY_DSN` in your environment variable and RQ will
+automatically start Sentry integration for you.
+
+```console
+RQ_SENTRY_DSN="https://my-dsn@sentry.io/123" rq worker
+```