Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add okcomputer check sidekiq retry queue #358

Open
elrayle opened this issue Aug 6, 2020 · 2 comments
Open

Add okcomputer check sidekiq retry queue #358

elrayle opened this issue Aug 6, 2020 · 2 comments
Assignees

Comments

@elrayle
Copy link
Contributor

elrayle commented Aug 6, 2020

Adapt from...

class SidekiqRetryQueueCheck < OkComputer::Check
  def check
    if sidekiq_retry_size > sidekiq_retry_size_threshold
      mark_failure
      mark_message "Sidekiq retry queue size (#{sidekiq_retry_size}) is above the threshold (#{sidekiq_retry_size_threshold})"
    else
      mark_message "Sidekiq retry queue size (#{sidekiq_retry_size}) is below the threshold (#{sidekiq_retry_size_threshold})"
    end
  rescue => e
    mark_failure
    mark_message "Unable to check sidekiq retry queue size with error: #{e}"
  end

  private

  def sidekiq_retry_size
    Sidekiq::Stats.new.retry_size.to_i
  end

  def sidekiq_retry_size_threshold
    Settings.sidekiq_retry_queue_threshold.to_i
  end
end

OkComputer::Registry.register 'sidekiq-retry', SidekiqRetryQueueCheck.new
@JesiBuell79
Copy link

Not sure what this is or if we need - will leave for you to judge --

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants