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 1802034: Silenced alerts should not show up in the Dashboards page of the console [4.5] #4539

Merged
merged 2 commits into from Mar 13, 2020

Conversation

dtaylor113
Copy link
Contributor

@dtaylor113 dtaylor113 commented Feb 27, 2020

This PR addresses hiding silenced alerts in the cluster dashboard

This PR removes alert watching/polling from Dashboards, and switches to use notificationAlerts (non-silenced, firing alerts) from the global Notification Drawer alerts & silences polling.

Now Silencing an Alert hides it from Cluster Dashboard:

Note: this PR affects the following plug-ins which will need to be updated to use the new notificationAlerts similar to how frontend/public/components/dashboard/dashboards-page/cluster-dashboard/status-card.tsx has been updated:

frontend/packages/ceph-storage-plugin/src/components/dashboard-page/storage-dashboard/status-card/status-card.tsx
frontend/packages/metal3-plugin/src/components/baremetal-hosts/dashboard/StatusCard.tsx
frontend/packages/noobaa-storage-plugin/src/components/status-card/status-card.tsx

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 27, 2020
@openshift-ci-robot openshift-ci-robot added component/core Related to console core functionality component/dashboard Related to dashboard labels Feb 27, 2020
@dtaylor113 dtaylor113 changed the title Hide silenced alerts cluster dashboard Bug 1802034: Silenced alerts should not show up in the Dashboards page of the console Feb 27, 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 Feb 27, 2020
@openshift-ci-robot
Copy link
Contributor

@dtaylor113: This pull request references Bugzilla bug 1802034, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1802034: Silenced alerts should not show up in the Dashboards page of the console

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.

@dtaylor113
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@dtaylor113: This pull request references Bugzilla bug 1802034, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1802034: Silenced alerts should not show up in the Dashboards page of the console

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.

@dtaylor113 dtaylor113 force-pushed the hide-silenced-alerts-cluster-dashboard branch from 550e92e to db7e670 Compare February 27, 2020 21:03
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 29, 2020
@dtaylor113 dtaylor113 force-pushed the hide-silenced-alerts-cluster-dashboard branch from db7e670 to f4a89ee Compare March 3, 2020 15:37
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 3, 2020
@dtaylor113
Copy link
Contributor Author

/retest

1 similar comment
@dtaylor113
Copy link
Contributor Author

/retest

@@ -104,7 +92,7 @@ export const withDashboardResources = <P extends DashboardItemProps>(
urlResultChanged ||
queryResultChanged ||
k8sResourcesChanged ||
(this.watchingAlerts && alertsResultChanged) ||
alertsResultChanged ||
Copy link
Contributor

Choose a reason for hiding this comment

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

this would cause unnecessary card rerendering even if it does not need to watch alerts.
I'd like to get rid of this HOC in the future - I'd prefer to connect the specific cards to redux/notificationAlerts instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point @rawagner. I could restore the watchAlerts functions/vars, minus the polling, in order to keep the watchingAlerts functionality in place to avoid unnecessary card rerendering (although in my limited experience I don't see alertsResultChanges that often), or do you feel the best solution is to connect the specific cards to redux/notificationAlerts in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

restoring the function would be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rawagner, is the 👍 for restoring watchAlerts or waiting to connect specific cards to redux/notificationAlerts in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

we can go with restoring the function for now. I will start getting rid of this HOC once #3443 is merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rawagner, restored watchAlerts functionality. PTAL

…tus card to use notificationAlerts from notificationDrawer alert polling
@dtaylor113 dtaylor113 force-pushed the hide-silenced-alerts-cluster-dashboard branch from f4a89ee to cb3ac2d Compare March 12, 2020 18:49
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 12, 2020
@openshift openshift deleted a comment from openshift-ci-robot Mar 12, 2020
@openshift openshift deleted a comment from openshift-ci-robot Mar 12, 2020
@@ -234,7 +229,8 @@ export type DashboardItemProps = {
stopWatchAlerts: StopWatchAlerts;
urlResults: RequestMap<any>;
prometheusResults: RequestMap<PrometheusResponse>;
alertsResults: RequestMap<PrometheusRulesResponse>;
alertsResults: RequestMap<PrometheusRulesResponse>; // TODO: remove once noobaa-storage-plugin, ceph-storage-plugin, and metal3-plugin status cards have been updated to switch over to alertNotifications, see https://github.com/openshift/console/pull/4539
notificationAlerts: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

There's already a better type in https://github.com/openshift/console/blob/master/frontend/public/components/notification-drawer.tsx#L325 . I think we should move it to reducers/ui.ts and reuse it in notification-drawer.tsx and with-dashboard-resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @rawagner, created/moved, pls see last commit for changes -thanks

@rawagner
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtaylor113, rawagner

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 Mar 13, 2020
@openshift-bot
Copy link
Contributor

/retest

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

10 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@dtaylor113
Copy link
Contributor Author

/retest

@spadgett spadgett added this to the v4.5 milestone Mar 18, 2020
@dtaylor113 dtaylor113 deleted the hide-silenced-alerts-cluster-dashboard branch June 4, 2020 15:49
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/core Related to console core functionality component/dashboard Related to dashboard lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants