Oban
The AppSignal for Elixir package instruments jobs performed by Oban workers, and collects metrics about your jobs' performance.
Oban is a job queueing and processing system for Elixir, based on PostgreSQL and Ecto. You can use Oban to schedule jobs to be ran in the background.
Automatic Instrumentation
Oban support is automatically instrumented, requiring no configuration.
To disable the Oban instrumentation, set the instrument_oban
config option to false
.
Error Reporting
By default, the Oban instrumentation will create an error sample whenever one of your workers fails to process a job, either by returning an {:error, _}
tuple or by throwing an exception.
If you only wish to send errors to AppSignal when the failure causes the job to be discarded, that is, once it's reached its maximum retry attempts, set the report_oban_errors
config option to "discard"
. Set it to "none"
to never send Oban job errors to AppSignal.
Performance and Error Samples
AppSignal will create performance samples out of jobs executed by your Oban workers:
It will also notify errors that cause your workers to fail while processing a job:
Within the performance and error samples, the tags will contain information about the job:
- Job ID, queue, worker and priority
- Number of previous attempts
- Job state and result after execution
Any tags or metadata values added to the job will also be present as tags in the sample, allowing you to filter the samples for a specific tag.
You will also be able to see when an Oban job is inserted in the event timeline of your application's performance samples:
Metrics
In addition to the performance and error samples, AppSignal for Elixir will collect metrics about the performance of your Oban jobs:
-
oban_job_duration
: the duration of the jobs processed, tagged by the job's worker, queue and status. -
oban_job_queue_time
: the time spent by jobs waiting in the queue, tagged by queue. -
oban_job_count
: the amount of jobs processed, tagged by the job's worker, queue and status.
Using this metrics, AppSignal will automatically create the Oban automated dashboard, which provides key insights into your Oban system's performance: