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

Monitoring dashboards: Initial commit #3771

Merged
merged 1 commit into from Dec 13, 2019

Conversation

kyoto
Copy link
Member

@kyoto kyoto commented Dec 12, 2019

Initial commit of the monitoring dashboards. Including laying out the
dashboard cards dynamically and rendering single stat, bar graph and
line graph cards.

Follow-up PRs will add

  • Table cards
  • Stacked line graphs
  • Chart legends
  • Dynamic loading for the list of available dashboards
  • Proper handling of dashboard variables
  • Apply "Time Range" and "Refresh Interval" options to all cards
  • Lots of styling

screenshot
screenshot2

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. component/core Related to console core functionality component/monitoring Related to monitoring labels Dec 12, 2019
@spadgett
Copy link
Member

/test analyze

@spadgett
Copy link
Member

@cshinn @andybraren Will it be confusing for users that there are two different sets of dashboards, Home -> Dashboards and Monitoring -> Dashboards? Have we considered showing these under the existing Home -> Dashboards page?

@spadgett
Copy link
Member

cc @alimobrem

@cshinn
Copy link

cshinn commented Dec 12, 2019

@cshinn @andybraren Will it be confusing for users that there are two different sets of dashboards, Home -> Dashboards and Monitoring -> Dashboards? Have we considered showing these under the existing Home -> Dashboards page?

I've heard tell of changing the current cluster dashboard to "Overview" or somesuch. This monitoring section could also be called "metrics dashboards". Either way, we've had this situation for a couple releases now, It's just where the link goes that's different

const [error, setError] = React.useState();

React.useEffect(() => {
const path = `${k8sBasePath}/api/v1/namespaces/openshift-monitoring/configmaps/grafana-dashboard-${board}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok great, can take a look at the configmaps from here.

This is where we need to have the discussion about ConfigMap vs CRD and the RBAC ramifications, as users may not be able to access these resources.

@andybraren
Copy link
Contributor

andybraren commented Dec 12, 2019

@spadgett I do think it'll be confusing.

We discussed this briefly back in October, but I think it's time to start calling what we know as "dashboards" today "overviews" instead (since that's what really what they are, philosophically) and free up that word to be used by these more traditional Metric Dashboards instead.

To get there, we would:

  • Rename the "Dashboards" nav item "Overview" with a page title of "Overview"
    • Rename the first "Overview" tab to "Cluster" instead
  • Rename the "Overview" tabs of every resource page "Details" instead
    • (Including the slideovers that appear within the Workloads tab of a Project page)
  • Add a "View all" link to the existing small Details card of the Project/Node/Host/VM overviews that would take the user to the full Details tab

I think this is worth POC'ing to see how it feels and see if we come across any major conflicts, but calling the existing things "overviews" seems better aligned with their purpose and our (prescriptive) extensibility plans for them, compared to these new traditional "dashboards".

FYI @rawagner

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Great to see this progress 👍

<HrefLink
href="/monitoring/query-browser?query0="
name="Metrics"
startsWith={['monitoring/query-browser']}
/>
)}
{showGrafana && <ExternalLink href={grafanaURL} name="Dashboards" />}
{canAccessPrometheus && <HrefLink href="/monitoring/dashboards" name="Dashboards" />}
Copy link
Member

@spadgett spadgett Dec 12, 2019

Choose a reason for hiding this comment

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

Let's hide the nav item until we're ready to expose the dashboards

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I reverted the changes in admin-nav.tsx for now


import { Alert } from '@patternfly/react-core';

const ErrorAlert: React.FC<Props> = ({ message, title = 'An error occurred' }) => (
Copy link
Member

Choose a reason for hiding this comment

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

I'd move this to shared components so it's a general utility we can use elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Moved to frontend/packages/console-shared/src/components/alerts/error.tsx

frontend/public/components/monitoring/dashboards/error.tsx Outdated Show resolved Hide resolved
Comment on lines 33 to 37
let result = s;
_.each(variables, (v, k) => {
result = result.replace(new RegExp(`\\$${k}`, 'g'), v);
});
return result;
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest reduce

  return _.reduce(variables, (result: string, v: string, k: string): string => {
    return result.replace(new RegExp(`\\$${k}`, 'g'), v);
  }, s);

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

justify-content: flex-start;
}

.monitoring-dashboards-dropdown {
Copy link
Member

Choose a reason for hiding this comment

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

We should follow BEM naming for these classes

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

frontend/public/components/monitoring/dashboards/index.tsx Outdated Show resolved Hide resolved
import { QueryBrowser } from '../query-browser';

const Graph: React.FC<Props> = ({ pollInterval, queries, timespan }) => (
<QueryBrowser
Copy link
Member

Choose a reason for hiding this comment

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

Happy to see we can reuse this 👍

@spadgett
Copy link
Member

@andybraren I guess I don't understand why Home -> Dashboards is an overview and not a dashboard. It looks like a dashboard to me :)

The way these two pages work under the hood is very different. That doesn't really matter to a user, though. They seem to fulfill the same fundamental purpose, and they look almost the same. Why not just add these as additional dashboards under the existing Home -> Dashboards page?

@cshinn
Copy link

cshinn commented Dec 12, 2019

@spadgett something similar was proposed back before the current dashboard existed. I think it's now made tricky because lots of different "metrics dashboards" can exist as well as several different "overview dashboards" for different subsystems. @sichvoge what are your thoughts on the relationship between these?

@andybraren
Copy link
Contributor

@spadgett Our reasoning is somewhat forward-looking, but IIRC @cshinn and I lean against placing these within Home -> Dashboards because:

  1. Everything in these dashboards is powered by Prometheus data (conceptually, Monitoring)
  2. Eventually, users might be able to add queries from within the Metrics page to new/existing Metric dashboards via the CR mechanism, or go the opposite direction and edit a query from a Metric dashboard within the Metrics page. Keeping them next to each other makes that connection more natural.
  3. When that day comes, it'll be difficult to explain why some "dashboards" are create-able & customizable by users and operators while others on the same page aren't.

@andybraren I guess I don't understand why Home -> Dashboards is an overview and not a dashboard. It looks like a dashboard to me :) .... They seem to fulfill the same fundamental purpose, and they look almost the same.

Maybe I've just been haunted by "dashboards" for so long that I feel the need to rename them. 😄

Although they do look visually similar-ish, I'd argue that they fulfill fundamentally different purposes and will only continue to functionally diverge in the future due to the architectural differences between them. Both are valid and useful, but as the differences grow, calling them the same thing may confuse more than it helps.

Overviews should continue to be prescriptive "windows" that highlight what's important 90% of the time (determined by our research & domain expertise) and help users quickly jump away to other areas of the Console that need human attention. The 5-6 cards we have today seem to do a decent job at that, and their deep integration into the Console and the API allows them to do things these new dashboards can't.

Dashboards have a clear path forward for deep customization, and their insight is scoped to what Prometheus collects (which is a lot). They have a different but similarly important focus, and they'll allow users to get deeper data-driven insights when necessary.

People will probably still call both of them "dashboards" anyway 🤷‍♂️ but it seems like our UI should at least attempt to make the functional & philosophical distinction clearer by not calling them the same thing and placing them next to one another.

FYI @sichvoge @jelkosz @rawagner @yuvalgalanti @serenamarie125 @beanh66 @lizsurette (related to an email discussion from October)

Initial commit of the monitoring dashboards. Including laying out the
dashboard cards dynamically and rendering single stat, bar graph and
line graph cards.
@openshift-ci-robot openshift-ci-robot added the component/shared Related to console-shared label Dec 13, 2019
@kyoto
Copy link
Member Author

kyoto commented Dec 13, 2019

Addressed feedback and also made a couple of other small improvements.

  • Pass panel data to <Table /> so that all the panel fields are available to it
  • Fix React warning caused by the Dropdown's onChange passing a second parameter that was being passed through to setBoard
  • Create types.ts for shared types

@kyoto
Copy link
Member Author

kyoto commented Dec 13, 2019

/test analyze

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

Thanks @kyoto. Let's get the initial work integrated so our teams can better collaborate, then we can expose the dashboards in the nav when ready. This is a fantastic start 👍

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kyoto, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@spadgett
Copy link
Member

@andybraren The way it's architected, the out-of-the-box dashboards won't be customizable. They're managed by operators, which will overwrite any changes you make. You would only be able to create and edit the dashboards you add. So there shouldn't be any confusion there.

It's not clear when or if we'd add that capability. Most likely it'd be driven by a cluster admin editing a custom resource and not through an editor in the UI.

I think we're still getting hung up on the implementation, and not what the user sees. Fundamentally, these pages are about the same thing: monitoring the state of your cluster. The look and behave basically the same regardless of what we call them.

@benjaminapetersen
Copy link
Contributor

I'll chime in along the same lines of @spadgett, Dashboard makes sense. I've honestly never liked the term Overview. Is it a summary page, or is it details? The term isn't clear, I don't think it really communicates not-dashboard.

For an administrator, these views seem to be essential to understanding how the cluster is doing. I'd be in favor of moving this up to Home -> Dashboards as well.

@openshift-merge-robot openshift-merge-robot merged commit dbd4684 into openshift:master Dec 13, 2019
@kyoto kyoto deleted the monitoring-dashboards branch December 16, 2019 00:52
@spadgett spadgett added this to the v4.4 milestone Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/monitoring Related to monitoring component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants