rails / solid_queue

Database-backed Active Job backend
MIT License
1.95k stars 130 forks source link

Add helper method to query the latency on the Queue object #415

Open andersonkrs opened 4 days ago

andersonkrs commented 4 days ago

Hey all!

I'm using Yabeda to collect some metrics on a rails app that uses solid_queue. I send some metrics like the latency on each queue. Currently I use a little patch to accomplish that. I wonder if we can upstream this path just to make it more convenient for other people to access solid_queue's API. 🤔

My Yabeda config example

Yabeda.configure do
  group :solid_queue do
    gauge :queue_latency, unit: :seconds, tags: [:queue]
  end

  collect do
    SolidQueue::Queue.all.each do |queue|
      solid_queue.queue_latency.set({ queue: queue.name }, queue.latency)
    end
  end
end