Repository navigation
Conversation
| __pycache__ | ||
| *.db | ||
| *.py[co] | ||
| *.egg-info/ |
There was a problem hiding this comment.
can remove if it's not wanted, a local uv sync created these, and most Python repos (that I know of) ignore *.egg-info/, so I added it.
|
Disclaimer: I have no pretension of being an expert in structured logging. However, I believe you might to consider changing your logs to maximize the power of structured logging. This is probably part of a next step of your plan so I understand that you did not change anything at this point. I just want to make sure you did not miss any important things for your big plan. Note: Changing logs is a breaking change to whatever log alerts you would have. Here's a few recommendation: The log's message should be treated like a unique ID for the log.I noticed your log's message is Ex: "task_failed" instead of f"Task {task_name} ...".
Use the metadata/kwargs of the structlog logging api to add what you would have included in your format earlier.Ex: django-structlog adds a multiple of them. See: Bind values that you want to be repeated on your logs.Binding values allows to repeat these metadata to each logs allowing to correlate logs together. django-structlog's request middleware automatically binds the request_id to the request's logs. django-structlog' celery integration automatically bind the task_id, request_id and I few more things that allows to trace all the things that happened in a single request or in a task. So if you notice something odd with a given task execution, you can get all the logs of the task using see:
CustomisationYou can customize the behaviour of a few things using django-structlog signals and configurations.
If there are things you'd like to improve or you face any problems, please open an issue or a PR. |
Description
Closes
Before / After
Success - before
Success - after
Failure - before
Failure - after
PS: Each failure now prints the traceback twice, once under "task_failed" and once under Celery's raised unexpected. Left as is.