-
Notifications
You must be signed in to change notification settings - Fork 15
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
NETOBSERV-1185 Console plugin async overview metrics #389
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
==========================================
+ Coverage 56.69% 57.64% +0.94%
==========================================
Files 29 169 +140
Lines 2025 7977 +5952
Branches 0 968 +968
==========================================
+ Hits 1148 4598 +3450
- Misses 761 3103 +2342
- Partials 116 276 +160
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
import { NamedMetric } from '../../api/loki'; | ||
import { MetricType } from '../../model/flow-query'; | ||
import { LOCAL_STORAGE_OVERVIEW_METRICS_DIMENSION_KEY, useLocalStorage } from '../../utils/local-storage-hook'; |
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.
Side remark: We might want to use some formatting tool to organize import automatically like we have on the go side
E.g. https://medium.com/weekly-webtips/how-to-sort-imports-like-a-pro-in-typescript-4ee8afd7258a
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.
return res.stats; | ||
}) | ||
]; | ||
if (!selectedPanels.some(p => [DROPPED_ID_MATCHER, DNS_ID_MATCHER, RTT_ID_MATCHER].includes(p.id))) { |
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.
not sure to understand this logic : if there's any of [drops/dns/rtt] in panels then we don't fetch the bytes/packets metrics? Why?
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 there is any panel which is not requiring special query (drop / dns / rtt),
then we query the defaults metrics..
An alternative could be to prepend a matcher to these defaults to manage this case the same way as nexts ones but users will loose their previous selections since it's stored in local storage.
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 might be wrong but I think that selectedPanels.some(p => [DROPPED_ID_MATCHER, DNS_ID_MATCHER, RTT_ID_MATCHER].includes(p.id))
is always false
.
This comes down to writing for instance ["drops", "dns", "rtt"].includes("top_avg_rtt_line")
, that's never going to happen (?)
Should it be instead:
selectedPanels.some(p => [DROPPED_ID_MATCHER, DNS_ID_MATCHER, RTT_ID_MATCHER].some(matcher => p.id.includes(matcher)))
?
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 would be more correct and is perhaps easier to understand:
if (selectedPanels.some(p => !p.id.includes(DROPPED_ID_MATCHER) && !p.id.includes(DNS_ID_MATCHER) && !p.id.includes(RTT_ID_MATCHER))) {
}
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 are right, thanks for catching that !
I applied your last suggestion: 15babbe
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.
mostly LGTM with just a doubt on something
I'll also run some tests before approving
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=3be4f7a make set-plugin-image |
After testing, I can confirm my comment here that showing only [dns/rtt/drops] panel won't save us from doing a standard flows query, so I think that should be fixed. Also a small thing, looks like the Globe icon alignment isn't perfect: Apart from that, this looks good |
should be better with that: 2be8de9 |
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
@nathan-weinberg would it be fine to merge this PR before QE validation ? I have 3 PRs needing these changes. If you prefer to take your time I will rebase them on this PR. |
/cc @Amoghrd @jpinsonneau If it's a breaking change, let's try and update the tests first so our regressions do not turn up false positives - i.e. prefer the rebase method :D Do we have a Jira for this change? |
I've created https://issues.redhat.com/browse/NETOBSERV-1348 for you guys |
/ok-to-test |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=ba1acf4 make set-plugin-image |
With changes in https://github.com/openshift/openshift-tests-private/pull/11959 the test cases remain stable: https://mastern-jenkins-csb-openshift-qe.apps.ocp-c1.prod.psi.redhat.com/job/ocp-veno/job/no-regression/280/ @jpinsonneau any manual verifications need to be done before merging? |
Not particularly. Just that the graphs still shows 😸 |
Sounds good - I am spinning up another cluster today to investigate some frontend failures @Amoghrd wanted me to double-check so I can do that as well! |
New changes are detected. LGTM label has been removed. |
Rebased the PR |
/ok-to-test |
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=74296d1 make set-plugin-image |
Full Success Run with our automated tests: https://mastern-jenkins-csb-openshift-qe.apps.ocp-c1.prod.psi.redhat.com/job/ocp-veno/job/no-regression/281/ |
/label qe-approved |
Thanks for the team effort ! 🥳 Merging now |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: 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 |
This PR improve Overview panel loading & code:
/loki/flow/records
/loki/flow/metrics
You can either check the number of queries in the side panel or in your browser debug -> network section to test this 🤓
*/!\ QE automated tests might break since the API route has been renamed and loading behavior changed /!*