-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Feature/add log grouping to UI #38021
Feature/add log grouping to UI #38021
Conversation
I ❤️ it. Been using it in GitHub for ages. Folding before/after execute automatically is cool. |
Just a warning - there might be some non-trivial performance issue created by it. But I think it's worth risking it. |
Yeah, mainly depending on your browser/CPU speed and log volume. Anyway will only hit of the regex can make a match in log lines, but will need to crawl over N log lines. Will do a short test. Today log is stopping to be processed at 1M lines, asking for download. |
Okay, did a test with a DAG and just created ~40.000 and ~400.000 log lines - in 400 log groups of 100/1000 lines content:
Test on Core i7-1280P / HP Laptop / Firefox (other browsers might be even faster) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one, it looks good!
I agree with Jarek on the performance issue, but IMHO we can merge it into beta and then decide if we need to add configuration to enable the feature and disable it by default.
airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx
Outdated
Show resolved
Hide resolved
3ced77d
to
8b695c1
Compare
Did some further performance measurement on my Laptop. Interesting, if logs are folded actually rendering is even faster than if no grouping... maybe because most content is hidden and saves rendering time:
All measured with my HP Laptop, Intel Core i7-1280P, Ubuntu 20.04. Measurement w/o proper tooling, just with a stop-watch :-D FYI the 400k logs were generated with the following code in a PythonOperator:
|
😱 -> yeah. that's likely not a very "realistic" example, but good enough. From my experience in GitHub Actions, the biggest issue is scrolling through HUGHE folded group - but I think a lot of it is becuase of the relatively slow backend handling a LOT LOT LOT of clients vs relatively fast front-end. Airlfow has far less of that problem - the webserver will be handling few (maybe few tens) of people maximum. |
Agree, not realistic but wanted to see the drop - and was surprised it is even faster in the case. I was fearing it is a lot slower but I have no fear anymore. |
airflow/www/static/js/dag/details/taskInstance/Logs/LogBlock.tsx
Outdated
Show resolved
Hide resolved
b52b1fa
to
7795efa
Compare
7795efa
to
6e75f6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
* Add folding feature for log group to web UI * Add folding feature for log groups, documentation * Group logs from pre-task execution and post-execution logs * Add state to the log block in grid view when task is running and logs are updated * Spelling * Review feedback * Review feedback v2 * Enhance unicode arrow symbol compatability
One issue with this is (IIUC) that it assumes that groups won't overlap. But logs for a TI can come from multiple sources and this might not always be true. First it was only worker. Then we added triggerer. Then we added scheduler (in exceptional circumstances). Now there is interest in logging to TI logs any action specific to a TI. (e.g. scheduler state changes). With AIP-44, there could be logs from webserver / internal API server. To the extent that these groups can overlap in time, the folding will be misleading. |
This PR is another "eye candy" for upcoming 2.9.0 release - and I hope I pass the review and merge if before release cut-off.
Logging is usually a mass of text. Tasks/Operators generate a lot of text and it is hard to read and understand what is going on. Expertise need to be built-up. In our departments users are mostly over-whelmed with the logs in Airflow.
A bit of filtering had been introduced but what I personally always was missing was a kind of log grouping which is existing in Github or also Azure DevOps Pipelines.
This PR adds Log Grouping also to Airflow with the following effects:
::group::Some Headline
and end it with::endgroup::
execute()
method, making logs clean per default (showing only real business logic)Example, how do logs look like for the
![image](https://private-user-images.githubusercontent.com/95105677/311542321-5718a2d1-70e6-4316-83bb-1c0ab104f47a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTUxNzksIm5iZiI6MTczOTcxNDg3OSwicGF0aCI6Ii85NTEwNTY3Ny8zMTE1NDIzMjEtNTcxOGEyZDEtNzBlNi00MzE2LTgzYmItMWMwYWIxMDRmNDdhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE0MDc1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiMzhhZmM1NGFjNWMyMDdkZDZhMzFlNmRiNDJhYmRiOTdkMDRjMTQ5OGRjZDBhZmZmZjFjZjM0MzJmNGM4MmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gAMFErWBR6tbF3yXg4ajvs8x8X2yfxVZYTTP6aM2XEA)
example_params_trigger_ui
DAG:If you click on the blue colored log group header, the section un-folds:
![image](https://private-user-images.githubusercontent.com/95105677/311542384-75f00c74-d9dc-453b-9a71-340e9afd44e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTUxNzksIm5iZiI6MTczOTcxNDg3OSwicGF0aCI6Ii85NTEwNTY3Ny8zMTE1NDIzODQtNzVmMDBjNzQtZDlkYy00NTNiLTlhNzEtMzQwZTlhZmQ0NGUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE0MDc1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2Mjc0MGNkZTc0ZWQ4NTU2MmNjNDg4YzIxMDc0MTdhNjhlODBkZTU3YWNiMmM4YjUxY2U0MmIxNzNlNjVkZjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.16jR35v3pbpGPyOQjxtLkhoXotXXzzDQpdTgh5HcnZA)
One example added to
![image](https://private-user-images.githubusercontent.com/95105677/311542485-ad5d83dd-42c5-40fc-b23c-49fe3146b1a2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3MTUxNzksIm5iZiI6MTczOTcxNDg3OSwicGF0aCI6Ii85NTEwNTY3Ny8zMTE1NDI0ODUtYWQ1ZDgzZGQtNDJjNS00MGZjLWIyM2MtNDlmZTMxNDZiMWEyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE2VDE0MDc1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmMmEwOWU3YzQ4NDkwZjNjODMwMDUzNmRkZjMwOWFkMWZhYTZmZDQ3MTQ0Y2IwNDVmOWJjNTg0YjJiMjMzMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9gAHf8k1pltTvtIOelWn2nN8evrypBi73lcVQkmQ_YE)
example_python_operator
DAG, prints are grouped giving the following results in the task logs:FYI @clellmann @wolfdn @AutomationDev85