Flower: Can not monitor scheduled tasks.

Created on 17 Jul 2013  路  21Comments  路  Source: mher/flower

I am using Celery 3.0 and Flower 0.5.2, and the broker is redis.

When celery worker is running, there is the worker in Flower Workers tab, this is good. However when I close celery worker and start celery beat service, it becomes nothing.

So where and how can I monitor the scheduled tasks which are triggerd by celery beat service in Flower?

Part of my celery config:

BROKER_URL = 'redis://localhost:6388/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6388/1'
CELERYBEAT_SCHEDULE = {
    'add-every-30-seconds': {
        'task': 'spider_tasks.add',
        'schedule': timedelta(seconds=30),
        'args': (16, 16)
    },
}

The celery beat log showed the add-every-30-seconds task run successfully, but I found nothing in all Flower pages.

Most helpful comment

Same issue. @dluctcat fixes celerybeat and flower problem with this one weird trick. Other dev's hate him!

All 21 comments

I got it.

@dlutcat This is a good example of where a future googler would like to have known more than "I got it" for this issue. Any chance you still know how to monitor the scheduled tasks?

Another bump on this, how did you solve the problem @dlutcat ?

Maybe enable CELERY_SEND_TASK_SENT_EVENT=True

have the same issue! so would @dlutcat show the trick?

Same issue. @dluctcat fixes celerybeat and flower problem with this one weird trick. Other dev's hate him!

I am sorry that I cannot remember the solution anymore. I read the old code and found nothing useful.

Strong everything

+1

+1

+1

Hello :) , have you found the solution? :)
@dlutcat @fatisar @dtardoin @ask @gmixo

I found a solution and it works:
celery worker -A proj -E -B -c 1 -l info

@netspyer could you explain the meaning of -E flag? Looks like my command for starting celery miss only -E flag.

@gmixo Which version of your Celery(_Mine is Celery 4.0.2_) ?
I found this option is available even in version 3.0 (the doc):

Send task-related events that can be captured by
monitors like celery events, celerymon, and others.

which is the key for flower to monitor your worker.
Moreover, flower DIDN'T watch beat (scheduler), it watches your task worker.

@gmixo
Using celery worker -B to embed a _beat_ scheduler, and monitor the worker.
-E flag is not available in command celery beat.

@netspyer excellent job, thanks for help! I use version 3.1.23, now adding -E flag.

The terrible frustration of finding this and learning that the OP didn't bother to record the solution (Fermat style) was tempered by the hilarious responses. So I had a good laugh, at least. Thanks all!

any solution?

run celery: celery worker -A app.tasks --loglevel=info -E
run beat: celery -A app.tasks beat
run flower: celery flower -A app.celery --broker=redis://localhost:6379/0 --broker_api=redis://localhost:6379/0
Now in the the the flower the scheduled event will be presented.

Thank u!

Was this page helpful?
0 / 5 - 0 ratings