Add sidekiq_job_attempt_threshold config variable

The same idea as Tadas Tamosauskas's commit, but implemented differently and for Sidekiq. I am happy to make whatever changes you'd like.
I pretty much agree with your objections. I didn't realize that you're
adding a Proc to the error handlers, I thought the handler was shoveling a
static method and I had to dig deeper.

Looking at this now I understand that I should be able to examine the
context object and selectively reject on a per-exception basis, as the Proc
block is being run every time there is an exception? If that seems correct
to you I will gladly change this to keep it in the proper namespace.





On Wed, Oct 22, 2014 at 3:15 PM, joshuap <notifications@github.com> wrote:

> In lib/honeybadger/notice.rb:
>
> > @@ -212,10 +212,18 @@ def ignore_by_class?(ignored_class = nil)
> >        ignored_class ? @ignore_by_class.call(ignored_class) : @ignore_by_class
> >      end
> >
> > +    # Ignore exceptions based on Sidekiq job retry count.
> > +    def ignore_by_sidekiq_attempts
> > +      threshold = ::Honeybadger.configuration.sidekiq_job_attempt_threshold.to_i || 0
> > +      retry_count = parameters['retry_count'].to_i || 0
>
> My other concern is that this would cause the notice to be ignored if
> *any* parameters include a retry_count key which is over the threshold.
> Unlikely edge case, but I think it's another reason to keep this kind of
> thing specific to the Sidekiq integration rather than checking it here.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/honeybadger-io/honeybadger-ruby/pull/98/files#r19248345>
> .
>