-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[AIRFLOW-4396] Provide a link to external Elasticsearch logs in UI. #5164
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
Conversation
12d51ba to
b274655
Compare
|
This is nice, thank you @kunalyogenshah ! Users using Airflow with Elasticsearch backend do likely want to utilize more those aggregation features Elasticsearch frontends, e.g. Kibana, provide. Before looking into the code, my opinion on the UI change is that we make the layout similar to how we do the log downloading--we allow users to choose the try number of the task instances. Do you think that make sense? |
|
@kunalyogenshah , not sure if this is the right way to show the UI. I think another approach(Lyft) is to leverage #5059 and #5094 which allows you to customize your task instance panel in generic way. |
|
And we have already did that at Lyft in prod for quite some time(https://eng.lyft.com/running-apache-airflow-at-lyft-6e53bb8fccff). cc @milton0825 |
|
Ah. Thanks @feng-tao . This seems to be exactly similar to what we've been trying to do. Let me look into using extra links instead. |
|
@feng-tao : A quick naive clarification question. Does this mean that the DAG operator itself must specify the link to Kibana as an extra link in its operator definition? Or is there a way to make that universal for all DAGs and tasks? |
|
@kunalyogenshah I think this is what you are looking for: #5094 |
|
+1 for @milton0825 , cc @Fokko as well |
|
Perfect. Thanks @milton0825 . I'll move my questions over to that PR for better context :) |
|
Bringing this thread back up to share some alternate thoughts. I'd like to advocate for this approach specifically for just logs look up for the following reasons :
Thoughts? |
|
@kunalyogenshah I am thinking about making I am fine with shipping this PR now and rework later to support what I proposed. |
13b3ea1 to
bb9334a
Compare
Codecov Report
@@ Coverage Diff @@
## master #5164 +/- ##
==========================================
- Coverage 78.67% 78.65% -0.03%
==========================================
Files 470 470
Lines 30026 30044 +18
==========================================
+ Hits 23623 23631 +8
- Misses 6403 6413 +10
Continue to review full report at Codecov.
|
KevinYang21
left a comment
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.
Just to confirm, this has been tested on your local environment and you've confirmed it was working right? Do you mind share the test setup( e.g. the frontend url w/o sensitive info) please?
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.
NIT: We can have an example comment here to make it easier to adapt.
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.
Done!
bb9334a to
e825d90
Compare
|
Yeah, I tested this by just changing the cfg file to include the frontend URL. The frontend URL I used is also included in the CFG file. |
e825d90 to
b599d8b
Compare
|
Tailored example URL from default cfg file. Caused parsing errors for the default file. For Kibana specifically, the format I used in testing was :
|
KevinYang21
left a comment
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.
Baking it for 2 more days to allow other committers to review. Then I'll merge
|
@kunalyogenshah This features is very interesting. Can you write documentation for this feature? The description in the configuration file is very little visible. I think you should add a note to the file: |
|
Hey @mik-laj . I can definitely write documentation if needed. Will send a followup PR. |
|
@kaxil can this PR cheery picked to 1.10.4? |
@milton0825 Yes please, that would be great. |
|
@KevinYang21 When you merge PRs can you double check the commit message correctly references the jira - the release scripts I use to make sure we get everything in to the release need it. In this case it was |
…pache#5164) (cherry picked from commit 52a9d4e)
Jira
Description
This PR adds a new button to the Airflow UI next to "View log" ("View log in ES"). It provides an external URL for visualizing the log, and renders the latest try for the Task, DAG and execution being looked up. This button is controlled by a new
elasticsearch_frontendconf param, which provides the template URL for viewing the corresponding log. Screenshot below :UI without frontend provided:

This is the UI when a frontend is provided:

Documentation update is pending code review. Will update documentation after.
Tests
Unit tested the UI and checked the console for errors in the JS. Button doesn't show up if the param is not defined.
Commits
Documentation
Code Quality
flake8