appsignal/appsignal-ruby

Report activejob errors only when the job is discarded

tombruijn opened this issue · 2 comments

In PR #1040 the activejob_report_errors config option was added. This only supports "all" (the orignal behavior to report all errors) and "none" (to disable error reporting).

It should also have the option to "discard", to only report errors if the job is discarded and no longer will be retried.

We can listen to the after_discard callback on the job, but I didn't manage to make it work yet, because in the test suite the job gets instantly retried, within the execute method we instrument, so we can't test if it crates one transaction without an error and one transaction with an error.

WIP branch: https://github.com/appsignal/appsignal-ruby/tree/active-job-error-discard

To do

  • Implement option in Ruby gem
  • Update activejob_report_errors docs to include discard

This issue seems is labeled as a new feature. Our customers may want to be informed about these changes through a blog post announcement. An issue has been created in blog repo so we remember to publish a blog post about it.

If a blog post is not required, please add the [skip blogpost] tag next time, and close the created issue.

This was released in Ruby gem 3.7.3. See also the docs for this https://docs.appsignal.com/ruby/integrations/active-job.html (once deployed in a min or two).