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

Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview #4091

Merged
merged 1 commit into from Feb 4, 2020

Conversation

vikram-raj
Copy link
Member

@vikram-raj vikram-raj commented Jan 28, 2020

Fixes:

https://issues.redhat.com/browse/ODC-2836

Analysis / Root cause:

For the metrics section in the overview monitoring, we show only 3 metrics for the workload. and there was no way to see all the metrics for the workload.

Solution Description:

Added View monitoring dashboard link which will redirect the user to monitoring dashboard and show all the metrics on the dashboard.

Screen shots / Gifs for design review:

Peek 2020-01-28 22-25

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 28, 2020
@openshift-ci-robot openshift-ci-robot added the component/dev-console Related to dev-console label Jan 28, 2020
@vikram-raj
Copy link
Member Author

cc: @serenamarie125

@serenamarie125
Copy link
Contributor

Can you add a bit more spacing above/below the link?
pf-global-spacer--sm (8 px)

here's a quick mock
Screen Shot 2020-01-28 at 10 43 09 AM

Comment on lines 46 to 50
query={
workloadName && workloadType
? q.query({ ns: namespace, workloadName, workloadType })
: q.query({ namespace })
}
Copy link
Member

Choose a reason for hiding this comment

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

can we have specs for this

Copy link
Member Author

Choose a reason for hiding this comment

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

@invincibleJai I will add a test case for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

added tests for this. PTAL.

@vikram-raj
Copy link
Member Author

Can you add a bit more spacing above/below the link?
pf-global-spacer--sm (8 px)

here's a quick mock
Screen Shot 2020-01-28 at 10 43 09 AM

Added the more space above and below the link.
Screenshot from 2020-01-28 22-24-16

Copy link
Contributor

@serenamarie125 serenamarie125 left a comment

Choose a reason for hiding this comment

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

Great thanks! Looks good to me

@vikram-raj
Copy link
Member Author

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 29, 2020
Comment on lines 21 to 27
let queries: MonitoringQuery[];

if (workloadName && workloadType) {
queries = workloadMetricQueries;
} else {
queries = monitoringDashboardQueries;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this can written as const queries: MonitoringQuery[] = workloadName && workloadtype ? workloadMetricQueries : monitoringDashboardQueries

@vikram-raj
Copy link
Member Author

/retitle Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview

@openshift-ci-robot openshift-ci-robot changed the title add view monitoring dashboard option for metrics section in monitoring overview Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview Jan 30, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 30, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1796463, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview

Instructions 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.

Comment on lines 40 to 49
workloadName && workloadType
? q.query({ ns: namespace, workloadName, workloadType })
: q.query({ namespace })
Copy link
Contributor

Choose a reason for hiding this comment

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

Change ns to namespace and update the templates for consistency. Not sure why it matters if workloadName or workloadType are undefined. There shouldn't be anything wrong with providing extra information that a template may not use.
query={q.query({ namespace, workloadName, workloadType })}

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed ns to namespace. I was not aware of this that we can pass extra information to a template that may not use.

import MonitoringDashboardGraph from '../dashboard/MonitoringDashboardGraph';

const WorkloadGraphs = requirePrometheus(({ resource }) => {
const ns = resource?.metadata?.namespace;
const workloadName = resource?.metadata?.name;
const workloadType = resource?.kind?.toLowerCase();
const queries = _.slice(workloadMetricQueries, 0, 3);
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the voodoo #3 :)
I'm a bit concerned that if the order of workloadMetricQueries changes that it will negatively impact this view. Perhaps create another exported value from the module that provides the set of queries to use here.

Copy link
Member Author

Choose a reason for hiding this comment

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

created an another module for overview metrics.

@@ -78,6 +79,15 @@ const MonitoringOverview: React.FC<MonitoringOverviewProps> = ({ resource, event
Metrics
</AccordionToggle>
<AccordionContent id="metrics-content" isHidden={!expanded.includes('metrics')}>
<h5 className="odc-monitoring-overview__view-monitoring-dashboard text-right">
Copy link
Contributor

Choose a reason for hiding this comment

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

Why an h5 ?
Should use pf4 utilities like pf-u-text-align-right if available instead of bootstrap.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed bootstrap text-right class and defined it in odc-monitoring-overview__view-monitoring-dashboard this class. Didn't find any pf4 utility for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm must be because we aren't importing those utilities. oh well

@christianvogt
Copy link
Contributor

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, serenamarie125, vikram-raj

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit ce739fe into openshift:master Feb 4, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: All pull requests linked via external trackers have merged. Bugzilla bug 1796463 has been moved to the MODIFIED state.

In response to this:

Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview

Instructions 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.

@vikram-raj vikram-raj deleted the ODC-2836 branch February 4, 2020 05:37
@spadgett spadgett added this to the v4.4 milestone Feb 4, 2020
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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. 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

9 participants