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 recent runs duration chart. #46504

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

tirkarthi
Copy link
Contributor

This uses the API to get recent 14 dag runs to plot the chart along with average of the run and queued duration as annotations. The size is 1/3 since there will be 2 more for success/failed rate and grouped durations as per design. This is for initial implementation and might not completely cover all use cases like Airflow 2 but can be taken up in subsequent PRs or separate issues for them as below. If approved a similar overview page can be created for task page as well in another PR for task duration.

Notes to self and review

  1. It seems stateColor.ts was removed. What is the recommended way to show color based on state for a given theme?
  2. Legend is not implemented now where in Airflow 2 it can be selected to show only those values.
  3. Duration is now in seconds and conversion to other units is yet to be implemented.
  4. x axis value is set to 3 since high number causes values to render vertically amidst smaller space.
  5. landing times based toggle is not implemented yet.
  6. Clicking on dagrun to take to the run page is not implemented yet.
  7. Autorefresh is not yet implemented.
  8. It seems even with limit of 14 passed more dagruns are returned. Changing it manually reflects correct value. Need to see if there is some cache issue.

image

image

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Feb 6, 2025
@tirkarthi tirkarthi added the AIP-38 Modern Web Application label Feb 6, 2025
@tirkarthi tirkarthi force-pushed the run-details-duration-chart branch from 2091a22 to f1a3349 Compare February 7, 2025 17:50
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to merge this as a good start. But we'll need to do auto refresh and improve the general design of it (accessibility, styling, the space the axis labels take up)

@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi , I suppose a very similar overview page will be present for each task too with recent failed task instances, task duration chart etc, as per the design.

http://localhost:8000/webapp/dags/tutorial_taskflow_api/tasks/load

@bbovenzi
Copy link
Contributor

bbovenzi commented Feb 7, 2025

Thanks @bbovenzi , I suppose a very similar overview page will be present for each task too with recent failed task instances, task duration chart etc, as per the design.

http://localhost:8000/webapp/dags/tutorial_taskflow_api/tasks/load

Yes, eventually we want to do a lot more with these dashboard views on the homepage and on a Dag or Task.

What were you trying to link here?

@tirkarthi
Copy link
Contributor Author

The link was to a sample task details page which now only has task instances and events tab. My understanding from the designs is that there will be a overview page for a task similar to dag page. The task duration chart was useful with median plot and it will be good to have it somewhere in Airflow 3 too.

@pierrejeambrun pierrejeambrun merged commit d719327 into apache:main Feb 10, 2025
35 checks passed
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
* Initial commit for dag run duration chart.

* Sort by start_date for recent runs.

* Add simple grid layout and border as per design.

* Use theme color for queued state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-38 Modern Web Application area:UI Related to UI/UX. For Frontend Developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants