Sentry supports monitoring scheduled Oban jobs and automatically capturing exceptions.

The Oban integration supports:

  • Capturing errors and exceptions that happen in Oban jobs.
  • Cron monitoring for scheduled Oban jobs.

This integration is built into the Sentry SDK starting with v10.2.0. It supports automatic monitoring starting with v10.3.0. It requires:

  1. Oban version 2.17.6 and up to be a dependency of your application.
  2. Elixir version 1.13 and up, (since that's required by Oban).

You can configure the Oban integration in your Sentry configuration, under the :integrations key:


config :sentry,
  # ...,
  integrations: [
    oban: [
      # Capture errors:
      capture_errors: true,
      # Monitor cron jobs:
      cron: [enabled: true]

This configuration will report failed Oban jobs to Sentry. It will also report started, completed, and failed jobs, as well as their duration. It will use the worker name as the monitor_slug of the reported cron.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").