Awesome
TaskBunnyRollbar
TaskBunny failure backend for Rollbar.
Installation
def deps do
[{:task_bunny_rollbar, "~> 0.1.1"}]
end
Sample configuration
config :rollbax,
access_token: "[YOUR_ACCESS_TOKEN]",
environment: "production",
enabled: true
config :task_bunny,
failure_backend: [TaskBunnyRollbar]
Check Rollbax or TaskBunny for more configuration options.
Gotcha
Report only when the job is rejected
You might not want to report the failures which are going to be retried. You can do it by writing a thin wrapper in your application.
defmodule TaskBunnyRollbarWrapper do
use TaskBunny.FailureBackend
alias TaskBunny.JobError
# reject = true means the job won't be retried.
def report_job_error(error = %JobError{reject: true}),
do: TaskBunnyRollbar.report_job_error(error)
# otherwise ignore.
def report_job_error(_), do: nil
end
Don't forget to set the wrapper module as your failure backend.
config :task_bunny, failure_backend: [TaskBunnyRollbarWrapper]
Copyright and License
Copyright (c) 2017, SQUARE ENIX LTD.
TaskBunnyRollbar code is licensed under the MIT License.