-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Improve Airflow logging for operator Jinja template processing #25344
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
By all means if you can improve it - feel free. This is a huge pain sometimes ! |
Best to iterate on a PR - then you can see the code /tests everything else and comment directly there. So feel free to open a PR about it. |
There is one comment I want to make though - it should be rather logged "after" the fact and only when there are problems. This will complicate the PR a bit but should be relatively easy to implement. We certainly do not want to flood the logs with thousands of rendering logs. |
Isn't this information already available in Rendered tab? |
Some people prefer CLI and logs to see problems I believe :) |
For sure but Jinja may also contain connection template (secrets). If we decide to add logging then we need to consider how to handle it. |
Logs are redacted - this should be no problem. |
Thanks, I'll try and create a PR some time in the next 1-2 weeks. |
PR created! |
Description
When an operator uses Jinja templating, debugging issues is difficult because the Airflow task log only displays a stack trace.
Use case/motivation
When there's a templating issue, I'd like to have some specific, actionable info to help understand the problem. At minimum:
Possibly also the Jinja context, although that can be very verbose.
I have prototyped this in my local Airflow dev environment, and I propose something like the following. (Note the logging commands, which are not present in the Airflow repo.)
Please let me know if this sounds reasonable, and I will be happy to create a PR.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: