Open orkenstein opened 4 years ago
We have the same problem:
celery_tasks_total{name="watcher.process_notifications",namespace="celery",queue="celery",state="RECEIVED"} 0.0
# skipped
celery_tasks_total{name="watcher.process_notifications",namespace="celery",queue="undefined",state="RECEIVED"} 1012.0
queue="celery" is wrong, we don't have celery queue with such a name. Same with the queue="undefined".
I checked how our Celery task events look like and it seems, that they are ok and contain all expected data.
Example of out task-received event:
{
"hostname":"worker-watcher@xyz.com",
"utcoffset":0,
"pid":1,
"clock":137700979,
"uuid":"fc8bb20f-4e1d-48ac-9f35-bbc0f7724143",
"name":"watcher.process_notifications",
"args":"()",
"kwargs":"{'notify_period': 'immediately'}",
"root_id":"fc8bb20f-4e1d-48ac-9f35-bbc0f7724143",
"parent_id":"None",
"retries":0,
"eta":"None",
"expires":"2020-06-17T11:55:42.823008+00:00",
"timestamp":1592387682.8286304,
"type":"task-received",
"local_received":1592394882.9463646
}
I have also noticed that I have not received any task-sent events, I run the exporter with --enable-events
flag.
We are aware of this bug it's not easy to refresh the queue list in real time. @itsx the "celery" queue is the default one is used to run internal celery tasks
Having the same issue:
celery_tasks_total{name="core.tasks.square",namespace="celery",queue="celery",state="SUCCESS"} 0.0
celery_tasks_total{name="core.tasks.square",namespace="celery",queue="undefined",state="SUCCESS"} 4.0
having the same issue, does anyone know how to fix this?
I have try added the following settings.
celery.conf.task_queues=(
Queue('task1_queue'),
Queue('task2_queue')
)
# with of without routing_key just the same
celery.conf.task_routes={
'task1': {'queue': 'task1_queue'},#,'routing_key':'task1'},
'task2': {'queue': 'task2_queue'}#,'routing_key':'task2'}
}
and send the task with following command however it seems like the metrics created the queue with name=undefined.
celery_app.send_task(
"task1", args=[], kwargs={"payload": jsonable_encoder(data),},time_limit=CELERYD_TASK_TIME_LIMIT,compression="gzip",queue="task1_queue"
)
Same here; all queues except celery
are named undefined
in the metrics output. I run the workers with --task-events
and despite that i start the exporter with --enable-events
.
By some reason the output is the following:
All recorded tasks have queue as "undefined".