Skip to content

Releases: Strech/sidekiq-prometheus-exporter

Add first Sidekiq contrib Sidekiq-Cron

22 Apr 17:00
17ea6dd
Compare
Choose a tag to compare

This release allows anyone to introduce their favourite Sidekiq contribs metrics easier and more isolated way. Each contrib now represented by a single exporter file and a template, for instance, a new sidekiq-cron exporter

Exporter

# Namespace is omitted
class Cron
  TEMPLATE = ERB.new(File.read(File.expand_path('templates/cron.erb', __dir__)))

  def self.available?
    defined?(Sidekiq::Cron)
  end

  def initialize
    @cron_jobs_count = Sidekiq::Cron::Job.count
  end

  def to_s
    TEMPLATE.result(binding).chomp!
  end
end

Template

# HELP sidekiq_cron_jobs The number of cron jobs.
# TYPE sidekiq_cron_jobs gauge
sidekiq_cron_jobs <%= format('%d', @cron_jobs_count) %>

If you want to change default auto-detect behaviour, please follow these instructions

New gauge sidekiq_queue_max_processing_time_seconds

04 Dec 21:00
Compare
Choose a tag to compare

This metric is gauge which shows the number of seconds spent by the most long-running job in a queue.

P.S Many thanks to @ckoenig for making this metric.

Minor code updates

28 Sep 10:33
Compare
Choose a tag to compare

Nothing serious, just a minor code update to push a new version on Rubygems instead of yanked 0.1.5.

Move Metrics class to the Sidekiq::Prometheus namespace

16 Sep 11:45
Compare
Choose a tag to compare

Thanks, @tmestdagh for spotting the issue with naming! 🎉

Fix bug with Pry.rb

04 Sep 17:07
Compare
Choose a tag to compare

Unfortunately, all tests were passing because I was confused by Pry.rb allow you to get a magical binding via nice call __binding__.

I've implemented the same, now everything is working

Rename `sidekiq_queue_size` to `sidekiq_queue_enqueued_jobs`

04 Sep 14:59
Compare
Choose a tag to compare

Because we have a total amount of enqueued jobs per all queues it makes sense to rename queue size to be an enqueued jobs.

Add new gauge metric `sidekiq_queue_size`

04 Sep 09:03
Compare
Choose a tag to compare

Calculated as a number of jobs pushed to the queue.