celery-prometheus-exporter
celery-prometheus-exporter copied to clipboard
How to extend for multiple queue monitoring?
Hello, I am curious as to how we can extend to expose metrics for multiple queues. Could you point me to where I can start? I am kind of a newbie at this so any guidance would be appreciated.
Sorry, didn't have the time to look into your request :( Did you already solve it on your own?
I saw from issue #19 you mention that the queue name was there in the task class. I thought that maybe I should start there and work to get multiple queue monitoring. So that's why I closed the issue. Going to re-open, though. How can we extend for multiple queues?
I‘m currently afk, but I’d guess that the information about the queue is also included in the submitted event. You could then add the queue as additional label in the _incr*
I hope this helps 🙂
I'll look into that, thanks!
I think this can be done by capturing and saving the task-sent event:
task-sent(uuid, name, args, kwargs, retries, eta,expires, queue, exchange, routing_key, root_id,parent_id)
... which can then be used to lookup queue, exchange and routing_key if desired, by uuid, then later discarded.
Anyone looked at that yet? Bit of work there to adapt current code, thinking not done yet ...