solid_queue icon indicating copy to clipboard operation
solid_queue copied to clipboard

Grafana dashboard

Open vitobotta opened this issue 11 months ago • 11 comments

Hi! Is there a ready dashboard for Grafana to display metrics regarding SolidQueue?

vitobotta avatar Dec 09 '24 12:12 vitobotta

Hey @vitobotta, no, not for Solid Queue, but there's this one for Active Job.

rosa avatar Dec 09 '24 16:12 rosa

Thanks @rosa! Tried it, but didn't work out since I'm using Prometheus Exporter rather than Yabeda. Guess I'll need to find another solution.

One option is to use Postgres directly as a source for Grafana and just run queries on the SolidQueue tables. However, there's no column that shows job duration. How can I figure out job durations then?

I really want to track job durations over time and spot the slowest jobs. Any ideas?

Thanks!

vitobotta avatar Dec 09 '24 17:12 vitobotta

Ahhhh, not really. You can check finished_at and compare it with scheduled_at, but that would include the time waiting in the queue. Active Job instrumentation events are much better but they're not tracked in the DB, you'd need to subscribe to them somewhere, publish the metrics and create a custom collector to collect them 🤔

rosa avatar Dec 09 '24 18:12 rosa

Got it, thanks for sharing your thoughts. I will definitely check out the instrumentation options.

By the way, are there any future plans to expose additional details or metrics with SolidQueue?

vitobotta avatar Dec 09 '24 19:12 vitobotta

No specific plans besides the instrumentation that already exists but I'm definitely open to ideas there!

rosa avatar Dec 09 '24 19:12 rosa

I see, thanks. Would be awesome to see some built in support for this in the future :)

vitobotta avatar Dec 09 '24 20:12 vitobotta

Hi!

No specific plans besides the instrumentation that already exists but I'm definitely open to ideas there!

Do you think if we can implement some controllers in the library so it can fetch the metrics from the database and then we would be able to make a UI on top of that? I think that would be the first step.

amirali-ashraf avatar Dec 31 '24 06:12 amirali-ashraf

@amirali-ashraf, could that perhaps live in https://github.com/rails/mission_control-jobs? Since that has controllers and specific code to query Active Job's queues and jobs 🤔

rosa avatar Dec 31 '24 06:12 rosa

@rosa let me have a look and get back to you!

amirali-ashraf avatar Dec 31 '24 13:12 amirali-ashraf

@rosa so, you are completely right! I have missed this library for a long time 🤷‍♂️ https://github.com/rails/mission_control-jobs

With this API and tools like https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource/latest/ @vitobotta probably can we get the info we want to be added to grafana?

amirali-ashraf avatar Dec 31 '24 13:12 amirali-ashraf

Hi @amirali-ashraf , sorry for the delay, I had set a reminder to reply but for the wrong month :D

Sounds like that dashboard could work, but I haven't tried it. I will look into it when I have time.

vitobotta avatar Feb 12 '25 14:02 vitobotta