Releases: Strech/sidekiq-prometheus-exporter
Add first Sidekiq contrib Sidekiq-Cron
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
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
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
Thanks, @tmestdagh for spotting the issue with naming! 🎉
Fix bug with Pry.rb
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`
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`
Calculated as a number of jobs pushed to the queue.