Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task's queue is 'undefined' #21

Open
orkenstein opened this issue May 14, 2020 · 6 comments
Open

Task's queue is 'undefined' #21

orkenstein opened this issue May 14, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@orkenstein
Copy link

orkenstein commented May 14, 2020

By some reason the output is the following:

celery_tasks_total{name="local.update_record",namespace="celery",queue="local_develop",state="STARTED"} 0.0
# skipped
celery_tasks_total{name="local.update_record",namespace="celery",queue="undefined",state="STARTED"} 1.0

All recorded tasks have queue as "undefined".

@itsx
Copy link
Contributor

itsx commented Jun 17, 2020

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":"[email protected]",
   "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.

@SharpEdgeMarshall
Copy link
Contributor

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

@johnnymetz
Copy link

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

@luvwinnie
Copy link

having the same issue, does anyone know how to fix this?

@SharpEdgeMarshall SharpEdgeMarshall added the bug Something isn't working label Apr 29, 2021
@luvwinnie
Copy link

luvwinnie commented Apr 30, 2021

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"
        )

@gergelypolonkai
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants