-
Notifications
You must be signed in to change notification settings - Fork 667
Add dashboards page with health card #1591
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
|
Hi @rawagner. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/assign |
|
/ok-to-test |
spadgett
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.
We should strive to build our UI by composing simple functional components instead of complicated class-based components.
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.
Is this an HTTP method like GET, HEAD, etc. or something else? Should have a real type.
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.
changed this a bit and added better types to make it clear. Its not called fetchMethod, but fetch which adds possibility to specify custom function for fetching remote resources.
frontend/public/components/dashboards-page/with-dashboard-resources.tsx
Outdated
Show resolved
Hide resolved
frontend/public/components/dashboards-page/with-dashboard-resources.tsx
Outdated
Show resolved
Hide resolved
|
@spadgett thank you for the quick review! I will go through the comments and once done I will let you know. |
|
We added this hook for polling prometheus to show area charts, and @TheRealJon is working on generalizing it so it's more generic. Just wondering if it makes sense to use a similar approach for the dashboards. Then we have a consistent polling mechanism throughout console and avoid duplicate logic. |
Do we have specific cases where prometheus query results are in fact shared across dashboard cards? I think this is where a lot of the complexity is coming in vs using a simple poll hook and a functional component. |
|
#1596 adds the generic |
Yes we do - we use the same queries for Capacity and Utilization card. Once Storage team contributes their Storage dashboard tab they will also want to reuse some storage queries and also Storage health query which will be the same for Health card in Overview and Storage tab. (Storage tab can seen here https://docs.google.com/presentation/d/15nDG3VuQRy6vJbMX4yq6ZvJ5G2Qawaz9glnLT8GEvX4/edit#slide=id.g4d3241551c_0_57 ) |
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.
@spadgett , isn't there a better place where to store strings all-together?
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.
@spadgett , isn't there a better place where to store strings all-together?
We don't currently externalize any strings, so there's no good place at the moment.
frontend/public/components/dashboards-page/overview-dashboard/health-card.tsx
Outdated
Show resolved
Hide resolved
frontend/public/components/dashboards-page/overview-dashboard/overview-dashboard.tsx
Outdated
Show resolved
Hide resolved
frontend/public/components/dashboards-page/with-dashboard-resources.tsx
Outdated
Show resolved
Hide resolved
a376426 to
5755038
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.
Do we ever intend to have dashboards with pod metrics for normal users? This function doesn't handle using the prometheus tenancy service that lets normal users fetch metrics.
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.
It is only as admin view for now. We dont have any dropdown for choosing other namespace than all for now.
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.
We can punt for now, but I'd assume we'd eventually want to replace the current project dashboard with the same experience reusing these components.
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.
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! UXD started to mockup dashboards with these skeleton screens some time ago and we plan to implement them too.
frontend/public/components/dashboard/health-card/health-card.scss
Outdated
Show resolved
Hide resolved
frontend/public/components/dashboard/health-card/health-card.scss
Outdated
Show resolved
Hide resolved
frontend/public/components/dashboards-page/with-dashboard-resources.tsx
Outdated
Show resolved
Hide resolved
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.
I think this is OK, but we should be careful that this won't hot loop.
frontend/public/style.scss
Outdated
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.
I'm not sure this is right.
cc @rhamilto
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.
Why is this needed? We import color-variables above
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.
color-variables is pf3, sass-utilities/colors is pf4. Variable names are slightly different $color-pf-black-100 (pf3) vs $pf-color-black-100 (pf4)
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.
Variable names are slightly different
$color-pf-black-100(pf3) vs$pf-color-black-100(pf4)
I'm not sure what to recommend, but that's going to get really confusing :(
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.
I could use the pf3 ones but some variables have different values :/ But if want, i will use it, it shouldnt be a big change and once ready we can switch all css variables to pf4.
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.
No, I would use the PF4 variables here. Just thinking about how to deal with this. Maybe we should create pf3- aliases for legacy colors to avoid confusion, but that's outside the scope of this PR.
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.
Worth a comment in this file explaining, though.
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.
comment added
|
Thank you for changing these to functional components. This looks a lot cleaner! |
frontend/package.json
Outdated
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.
We should align on how we handle this. Currently console uses this custom hook:
We might look at something based on hooks like:
https://github.com/rehooks/component-size
There are also polyfills for ResizeObserver:
https://caniuse.com/#search=ResizeObserver
https://github.com/que-etc/resize-observer-polyfill
@christianvogt mentioned dev console needs it for topology view as well.
cc @TheRealJon
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.
I tried useRefWidth and it works fine for me. react-measure dep is gone.
bf5d826 to
272cb86
Compare
|
Can you check the linter errors? |
prettier! Thats great. Linting errors are fixed now. |
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.
If this is only used in one place for the header, can it just be a style on co-dashboard-header__icon instead of having a separate class?
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.
right, merged those two to one class co-dashboard-header__icon
frontend/public/components/dashboard/dashboard-card/card-help.tsx
Outdated
Show resolved
Hide resolved
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.
| stopWatchURL('healtz'); | |
| stopWatchURL('healthz'); |
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.
oops, fixed
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.
I think it's cleaner to make this an expression directly in the markup from the return value below.
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.
Sounds good to me. Its now part of return statement
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.
You're not checking if the flag is pending, so it could flash the wrong product name briefly on initial load.
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.
added check for pending flag. While the flag is pending we show loading in Health card body and See All link is not shown at all
frontend/public/style.scss
Outdated
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.
Why is this needed? We import color-variables above
|
/approve Please squash, thanks! |
|
commits squashed |
spadgett
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.
/lgtm
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@spadgett Can you please approve again ? I had to rebase and it removed the label. Thank you! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rawagner, spadgett, vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR introduces dashboards page as designed in https://docs.google.com/document/d/1q0DIcUKgFhvNbtGt-SMl35Z2jHA_QO2r7aaBuFmwE2U/edit#heading=h.koix4vo7e16v
Dashboards page has its own redux store to be able to share resources (prometheus queries results, various url requests and in the future also k8s resources) between various dashboard cards and also dashboard tabs.
Dashboards page currently contains only one tab (Overview) - plan is to be able to contribute other tabs via static extension mechanism. Overview tab contains only one card - Health which can be extended via static plugin mechanism to show healths for other subsystems (ie KubeVirt or Storage).
Other cards will follow in separate PRs.
Dashboard page is not included in navigation yet, but can be accessed directly via
/dashboardsroute.Dashboards page - Overview tab

Dashboards page - Overview tab with demo-plugin enabled

@vojtechszocs @cloudbehl