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

Add child_task_id and child_task_name to task_revoked log #317

Closed
badziyoussef opened this issue Sep 25, 2023 · 4 comments · Fixed by #318
Closed

Add child_task_id and child_task_name to task_revoked log #317

badziyoussef opened this issue Sep 25, 2023 · 4 comments · Fixed by #318

Comments

@badziyoussef
Copy link
Contributor

To be able to know which task was revoked, it could be a good idea to bind child_task_id and child_task_name to task_revoked log

@jrobichaud
Copy link
Owner

jrobichaud commented Sep 26, 2023

Thanks for pointing that out.

The pre-release 6.0.0.dev3 is out on pypi with the fix.

Since it is a pre-release you need to specify the version explicitly:

pip install django-structlog==6.0.0.dev3

Let me know if it works as you expected.

Take note the names are different than you requested. See: task-event-metadata

I will release version 6.0.0 when python 3.12 will be officially out.

@badziyoussef
Copy link
Contributor Author

Thanks for pointing that out.

The pre-release 6.0.0.dev3 is out on pypi with the fix.

Since it is a pre-release you need to specify the version explicitly:

pip install django-structlog==6.0.0.dev3

Let me know if it works as you expected.

Take note the names are different than you requested. See: task-event-metadata

I will release version 6.0.0 when python 3.12 will be officially out.

I was expecting same keys on all logs to be able to automatise processing or filtering on them, but this solution is good aswell, thanks for the change

@jrobichaud
Copy link
Owner

jrobichaud commented Sep 26, 2023

child_task_id and child_task_name are specific to the enqueue of task in a parent (request or another task). I could not bind task_id in the enqueue because we could be already in a task.

Revoked task is done in a worker's perspective where the task being executed is revoked. (or never had the chance to start).

task_id and task respectively seemed more appropriate in that perspective.

@badziyoussef
Copy link
Contributor Author

child_task_id and child_task_name are specific to the enqueue of task in a parent (request or another task). I could not bind task_id in the enqueue because we could be already in a task.

Revoked task is done in a worker's perspective where the task being executed is revoked. (or never had the chance to start).

task_id and task respectively seemed more appropriate in that perspective.

very clear, thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants