Export queue stats on the metrics endpoint
Author: gergelypolonkaiCreated Dec 7, 2021Updated Jun 6, 2024
Labelsenhancement
I’d like to autoscale my Celery workers (running in Kubernetes) based on the queue “length”; e.g. if there are many tasks scheduled in queue A, i’d boot up a few more workers for that queue.
I’d imagine either a queue length
flower_queue_length{queue="queue-a",type="task-received"} 385.0and/or the queue name exposed in flower_events_total:
flower_events_total{task="task-for-b",queue="queue-a",type="task-received",worker="celery@worker-b"} 385.0Source: mher/flower