Skip to content

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Sep 4, 2024

Description

  • improved error and empty messages
    - improved /status endpoint to return more info
    - get namespaces count per storage to ensure consistency
    - added link to FlowCollector CR
  • fixed empty quick actions missing when results are empty
  • added missing empty message in topology view
  • fixed missing namespace in queries (dropdown and resource tab)
  • improved error label missing on prometheus query for Src / Dst Namespace

Also took the opportunity to fix the following issues as it was small fixes:

image
image
image
image
image
image

As this PR is getting bigger and bigger, I have created followups: https://issues.redhat.com/browse/NETOBSERV-1828 & https://issues.redhat.com/browse/NETOBSERV-1829

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Copy link

openshift-ci bot commented Sep 4, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@jpinsonneau jpinsonneau changed the title NETOBSERV-1538 & NETOBSERV-1819 error messages and UI polishing NETOBSERV-1538 & NETOBSERV-1819 & NETOBSERV-1813 error messages and UI polishing Sep 4, 2024
Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 37.91822% with 167 lines in your changes missing coverage. Please review.

Project coverage is 56.03%. Comparing base (96729c2) to head (55d93e0).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
pkg/handler/resources.go 12.82% 33 Missing and 1 partial ⚠️
pkg/handler/status.go 24.32% 26 Missing and 2 partials ⚠️
web/src/components/messages/error.tsx 13.33% 26 Missing ⚠️
...b/src/components/drawer/netflow-traffic-drawer.tsx 20.83% 18 Missing and 1 partial ⚠️
web/src/components/messages/empty.tsx 59.37% 12 Missing and 1 partial ⚠️
pkg/prometheus/client.go 0.00% 12 Missing ⚠️
web/src/components/messages/secondary-action.tsx 63.15% 7 Missing ⚠️
pkg/handler/loki.go 16.66% 5 Missing ⚠️
web/src/utils/filter-options.ts 54.54% 5 Missing ⚠️
pkg/handler/topology.go 0.00% 4 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #589      +/-   ##
==========================================
- Coverage   56.27%   56.03%   -0.25%     
==========================================
  Files         190      193       +3     
  Lines        9304     9457     +153     
  Branches     1201     1207       +6     
==========================================
+ Hits         5236     5299      +63     
- Misses       3698     3784      +86     
- Partials      370      374       +4     
Flag Coverage Δ
uitests 57.75% <46.83%> (-0.05%) ⬇️
unittests 51.32% <25.22%> (-0.75%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/handler/clients.go 46.66% <100.00%> (+3.80%) ⬆️
pkg/server/routes.go 70.73% <100.00%> (ø)
web/moduleMapper/dummy.tsx 47.36% <ø> (ø)
web/src/api/loki.ts 85.71% <ø> (ø)
web/src/components/netflow-traffic-tab.tsx 62.50% <100.00%> (ø)
web/src/components/netflow-traffic.tsx 68.58% <100.00%> (+0.09%) ⬆️
...ponents/tabs/netflow-overview/netflow-overview.tsx 74.92% <100.00%> (+0.07%) ⬆️
...rc/components/tabs/netflow-table/netflow-table.tsx 58.82% <100.00%> (-0.69%) ⬇️
...ponents/tabs/netflow-topology/netflow-topology.tsx 35.22% <ø> (ø)
...components/toolbar/filters/autocomplete-filter.tsx 62.76% <ø> (-0.78%) ⬇️
... and 16 more

@jpinsonneau jpinsonneau force-pushed the 1538 branch 2 times, most recently from bfe940b to cc96079 Compare September 5, 2024 10:21
@jpinsonneau jpinsonneau requested a review from jotak September 5, 2024 10:29
@jpinsonneau jpinsonneau marked this pull request as ready for review September 5, 2024 10:29
@jpinsonneau jpinsonneau force-pushed the 1538 branch 2 times, most recently from c57f769 to e25c6cd Compare September 5, 2024 10:54
@jpinsonneau jpinsonneau changed the title NETOBSERV-1538 & NETOBSERV-1819 & NETOBSERV-1813 error messages and UI polishing NETOBSERV-1538 & NETOBSERV-1819 & NETOBSERV-1813 & NETOBSERV-1812 error messages and UI polishing Sep 6, 2024
@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

New image:
quay.io/netobserv/network-observability-console-plugin:7b4256d

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=7b4256d make set-plugin-image


getStatus(ContextSingleton.getForcedNamespace())
.then(status => {
console.info('status result', status);
Copy link
Member

Choose a reason for hiding this comment

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

debug log to remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel it's useful to keep that in the console in case the UI don't show everything but I can remove it if you prefer

IsAllowLoki bool `yaml:"isAllowLoki" json:"isAllowLoki"`
LokiNamespacesCount int `yaml:"lokiNamespacesCount" json:"lokiNamespacesCount"`
IsLokiReady bool `yaml:"isLokiReady" json:"isLokiReady"`
IsConsistent bool `yaml:"isConsistent" json:"isConsistent"`
Copy link
Member

Choose a reason for hiding this comment

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

If I'm right, you can remove this IsConsistent from the REST API because it's not used in the js code - it's re-computed there (and I'd be in favor to keep it that way, computed on frontend side only, since it has all the data to compute it).

Also, we need to see if we find false-positives of this consistency check - I'm fine to keep it for the time being, but given that metrics are configurable, I'm wondering if there could be undesired "inconsistent" triggers. We'll see

status.isAllowProm &&
status.lokiNamespacesCount !== status.promNamespacesCount && (
<Text component={TextVariants.blockquote}>
{t(`Loki and Prom storages are not consistent. Check health dashboard for errors.`)}
Copy link
Member

@jotak jotak Sep 16, 2024

Choose a reason for hiding this comment

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

Prom => Prometheus. Also, I'd add more details to this text, because "not consistent" isn't very clear. Maybe "Loki and Prometheus storages seem diverging, they do not capture the same number of namespaces" ?

Also, a potential cause of trigger is when new namespaces are created, flows being caught in loki faster than in prometheus, so I guess this message will display in such case. That could make the users worry for nothing?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, this is only showed when an error occurred right? When the backend returns data, it won't be displayed? If so, then I guess it's not that an issue to have a small amount of false positives

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only showing when an error or empty content is displayed indeed

return props.resetDefaultFilters;
}
return undefined;
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Member

Choose a reason for hiding this comment

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

why disable linter, it seems to have already all the needed deps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without that, the linter expect props to be the dependency here and it will refresh on every change.

Copy link
Member

Choose a reason for hiding this comment

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

we can destructure props (just the bits we need) to get them back: b42aaca

return props.clearFilters;
}
return undefined;
// eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Member

Choose a reason for hiding this comment

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

same here

@jotak
Copy link
Member

jotak commented Sep 16, 2024

Hey @jpinsonneau ,
Not sure if it's this PR, but I'm not seeing the scope slider in Developer console view:
image

// get namespaces using Prom
promNamespaces, code, err := h.getNamespacesValues(ctx, promClients, isDev)
if err != nil {
writeError(w, code, "Error while fetching label namespace values from Prometheus: "+err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Here and below: the downside of throwing an error is that on the frontend side we loose the information about what is enabled (loki and/or prom). Since this is a status check, what about, instead of throwing an error, just set false to IsLoki/PromReady + add the error as a message embedded in the Status result?

Copy link
Member

Choose a reason for hiding this comment

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

To illustrate:
image

Here on the frontend side we could determine what to display based on if it's a loki or a prometheus permission error, but we don't know that due to the status endpoint failing to provide the status.

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 16, 2024
@jpinsonneau
Copy link
Contributor Author

Hey @jpinsonneau , Not sure if it's this PR, but I'm not seeing the scope slider in Developer console view: image

I have reduced the scope slider height following this ticket https://issues.redhat.com/browse/NETOBSERV-1813
https://github.com/netobserv/network-observability-console-plugin/pull/589/files#diff-7e4584cf94c2b3e49fda944ca9ad2742042d92e899fd909d1ce69ff20da4b2d0R34

jpinsonneau and others added 5 commits September 16, 2024 12:54
- When there's permission issue with prom user, fallback on using loki
  (like we also do for regular metrics queries)
- Do not try using prom for labels not in prom metrics
- Fix misleading error messages
- Do not disallow filter creation in case of autocompletion error
@jotak jotak changed the title NETOBSERV-1538 & NETOBSERV-1819 & NETOBSERV-1813 & NETOBSERV-1812 error messages and UI polishing NETOBSERV-1538 & NETOBSERV-1819 & NETOBSERV-1813 & NETOBSERV-1812 & NETOBSERV-1798 error messages and UI polishing Sep 16, 2024
@jotak jotak added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 16, 2024
Copy link

New image:
quay.io/netobserv/network-observability-console-plugin:3cf9850

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=3cf9850 make set-plugin-image

@jotak
Copy link
Member

jotak commented Sep 16, 2024

Hey @jpinsonneau , Not sure if it's this PR, but I'm not seeing the scope slider in Developer console view: image

I have reduced the scope slider height following this ticket https://issues.redhat.com/browse/NETOBSERV-1813 https://github.com/netobserv/network-observability-console-plugin/pull/589/files#diff-7e4584cf94c2b3e49fda944ca9ad2742042d92e899fd909d1ce69ff20da4b2d0R34

I would say that hiding it completely is worse than having some text overlap? It's still useful despite the cosmetic issue...
what if, instead of hiding, we write some initials instead? (C / AZ / NS / N / W / R) . I mean, ok that's not perfect and we need a better UX for this, but even imperfect I feel like it's better having it. Without it I feel incapable :)

@jpinsonneau
Copy link
Contributor Author

Hey @jpinsonneau , Not sure if it's this PR, but I'm not seeing the scope slider in Developer console view: image

I have reduced the scope slider height following this ticket https://issues.redhat.com/browse/NETOBSERV-1813 https://github.com/netobserv/network-observability-console-plugin/pull/589/files#diff-7e4584cf94c2b3e49fda944ca9ad2742042d92e899fd909d1ce69ff20da4b2d0R34

I would say that hiding it completely is worse than having some text overlap? It's still useful despite the cosmetic issue... what if, instead of hiding, we write some initials instead? (C / AZ / NS / N / W / R) . I mean, ok that's not perfect and we need a better UX for this, but even imperfect I feel like it's better having it. Without it I feel incapable :)

Yeah that would be better indeed. This is a temporary fix until we do https://issues.redhat.com/browse/NETOBSERV-1476

@jotak
Copy link
Member

jotak commented Sep 17, 2024

text added for prometheus errors / troubleshooting:
image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 17, 2024
@jotak
Copy link
Member

jotak commented Sep 17, 2024

/lgtm
@jpinsonneau can you also check my last commits if that's good with you?

Copy link

openshift-ci bot commented Sep 17, 2024

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci bot removed the lgtm label Sep 17, 2024
Copy link

openshift-ci bot commented Sep 17, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jotak. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@jpinsonneau
Copy link
Contributor Author

/lgtm @jpinsonneau can you also check my last commits if that's good with you?

Added a small change 55d93e0

LGTM

@Amoghrd
Copy link
Member

Amoghrd commented Sep 18, 2024

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Sep 18, 2024
Copy link

New image:
quay.io/netobserv/network-observability-console-plugin:e61421c

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=e61421c make set-plugin-image

@jpinsonneau
Copy link
Contributor Author

Merging this for branch cut. Please create followup bug if needed

@jpinsonneau jpinsonneau merged commit 4ef2efd into netobserv:main Sep 20, 2024
11 of 12 checks passed
@Amoghrd
Copy link
Member

Amoghrd commented Sep 20, 2024

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved QE has approved this pull request label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. qe-approved QE has approved this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants