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 dag run and task instance metrics to dashboard. #43888

Merged
merged 9 commits into from
Nov 14, 2024

Conversation

tirkarthi
Copy link
Contributor

Related #42700

Adds dag run and task instance metrics from historical metrics endpoint to dashboard.

  • The bar charts will be added later once API is available.
  • Checkboxes are missing. It seems in chakra 3 adding a components takes a few more steps.
  • State colors are of more contrast and might need to be toned down.
  • Some padding to center text in the status box. Probably there should be some bubble text type of component.
  • Currently the select box has preset hours shown to users at last 1, 8, 12 and 24 hours. This can be a component where users can select date time freely on their own. Probably need to see if this needs to be limited since using 30 days might take a lot of time to query and render the plot.

image
image

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Nov 11, 2024
@bbovenzi
Copy link
Contributor

Nice start!

A few other thoughts:

  • In a separate PR, I definitely need to adjust the task colors because they do not work in both light and dark mode.
  • Let's use a more subtle color for the percentage bars
  • We need a bit more vertical space under the titles of each section
  • Eventually, we need a full date range selector instead of just a few preset dropdown options

@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi for the comments. Did the following changes.

  1. Refactored Metrics.tsx to HistoricalMetrics folder with one component per file.
  2. Updated colors to use semantic codes.
  3. Added a custom badge component that can be updated so that the badge looks same across the components.

Eventually, we need a full date range selector instead of just a few preset dropdown options

Agreed, it looks like Chakra doesn't have a datepicker component. So something like https://www.npmjs.com/package/react-datepicker can be used or one of the options from the discussion chakra-ui/chakra-ui#580 . The datepicker can be a general component since it will be used across the app.

Feel free to push to the branch if you have any changes directly too. Thanks.

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.

A few more nits.

@tirkarthi
Copy link
Contributor Author

Applied all the PR comments locally and rebased with latest main branch. Thanks.

@pierrejeambrun
Copy link
Member

Are screenshots up to date following latest changes ? Just to get a rough idea of the rendered UI.

@tirkarthi
Copy link
Contributor Author

Latest screenshots after the review changes. Most of it has been moving Metrics.tsx to HistoricalMetrics with one component per file. Moving from text customization to using Badge and a few text size, padding, margin changes.

image

image

@pierrejeambrun
Copy link
Member

Looking nice.

Just a minor nit, it looks like the number in the badge is not centered vertically. Maybe that's just because of the screenshot but it looks slightly off.

@tirkarthi
Copy link
Contributor Author

Yes, in the layout tab for the badge WxH is 15.5667×20 in Firefox on Ubuntu for me. I can see the centering not correct in inspect toolbar. The padding is equally applied at the y-axis with py={1} . @bbovenzi mentioned the same in the comment but couldn't figure out the right change in CSS.

#43888 (comment)

@tirkarthi
Copy link
Contributor Author

It appears okay in Brave on Ubuntu. Probably a Firefox/Linux issue as many have reported it in chakra-ui/chakra-ui#983 , chakra-ui/chakra-ui#2314

localhost_8000_webapp_ (1)

@pierrejeambrun
Copy link
Member

It appears okay in Brave on Ubuntu. Probably a Firefox/Linux issue as many have reported it.

Nice to hear, thanks for investigating.

@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi for the feedback. Made the below changes as per latest review.

  1. Simple skeleton for dagrun and task instance sections. A better one would be using SkeletonCircle for badge and SkeletonText for the bar for each state in https://www.chakra-ui.com/docs/components/skeleton . I can take it up in another PR since it's not urgent.

image

  1. I have refactored the datetime selector into a separate component. I would like to access the state changes to startDate and endDate to pass to API. I had tried to use the pattern as per state lifting docs. Please let me know if there is any other correct approach. https://react.dev/learn/sharing-state-between-components .

  2. I will make the changes related to end_date being null once the PR changes are merged and not to block this PR.

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.

Nice work! A few small nits before we can merge.

@bbovenzi
Copy link
Contributor

bbovenzi commented Nov 14, 2024

Lgtm! We can iterate on a more detailed loading state and update end_date later.

@bbovenzi bbovenzi merged commit 87445bf into apache:main Nov 14, 2024
40 checks passed
@tirkarthi
Copy link
Contributor Author

Thanks @bbovenzi and @pierrejeambrun .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants