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
Conversation
cc: @serenamarie125 |
query={ | ||
workloadName && workloadType | ||
? q.query({ ns: namespace, workloadName, workloadType }) | ||
: q.query({ namespace }) | ||
} |
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.
can we have specs for this
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.
@invincibleJai I will add a test case for this.
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 tests for this. PTAL.
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.
Great thanks! Looks good to me
/kind bug |
let queries: MonitoringQuery[]; | ||
|
||
if (workloadName && workloadType) { | ||
queries = workloadMetricQueries; | ||
} else { | ||
queries = monitoringDashboardQueries; | ||
} |
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.
this can written as const queries: MonitoringQuery[] = workloadName && workloadtype ? workloadMetricQueries : monitoringDashboardQueries
/retitle Bug 1796463: add view monitoring dashboard option for metrics section in monitoring overview |
@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:
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. |
workloadName && workloadType | ||
? q.query({ ns: namespace, workloadName, workloadType }) | ||
: q.query({ namespace }) |
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.
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 })}
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 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); |
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.
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.
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.
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"> |
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 an h5
?
Should use pf4 utilities like pf-u-text-align-right
if available instead of bootstrap.
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.
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.
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.
hmm must be because we aren't importing those utilities. oh well
/lgtm |
[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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
@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:
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. |
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:
Browser conformance: