0

I'd like to be able to have a callback if a sidekiq job has not completed in 10 seconds (probably send an SMS or somethign via Twilio). When a sidekiq job is not running, it is critical for my business - I honestly like to see and track every change through the different statuses of a job and log it. Say for example, any job is taking over 20 seconds, then I should be alerted.

I'd like this logic to be part of my Worker perform method as I don't want to manage in my Rails conttroller.

I've seen sidekiq-status https://github.com/utgarda/sidekiq-status from this SO question Best way to monitor for completion of a Sidekiq job?. But it's not clear to me how this should be working. Should I be polling for the status? Or is there a better way to handle this?

Community
  • 1
  • 1
timpone
  • 19,235
  • 36
  • 121
  • 211

1 Answers1

1

I think you want to monitor queue latency. https://github.com/mperham/sidekiq/wiki/Monitoring#monitoring-queue-latency

Mike Perham
  • 21,300
  • 6
  • 59
  • 61
  • thx for response, kinda a couple of issues in my original question. thinking through this, I think I'm going to create a skq_current object / table which will be a list of currently executing sidekiq jobs and when they finish move to a skq_log table which will keep a record of the length of time of each job. I'll also create a clockwork job that will check the skq_current table every 10 seconds and increment a count and send a text SMS if anything is taking > 30 seconds. A bit excessive maybe but critical that these jobs are monitored VERY closely. thx again and if any thoughts, lmk – timpone Oct 16 '14 at 22:40