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 1883200: fix silence toggle in devconsole monitoring #6756

Merged
merged 1 commit into from Oct 2, 2020

Conversation

vikram-raj
Copy link
Member

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

Fixes:
https://issues.redhat.com/browse/ODC-4423

GIF
Kapture 2020-10-01 at 12 43 25

Test Setup

  1. oc apply -f https://gist.githubusercontent.com/vikram-raj/d801e9ef6400cc1bd5af5a336bbedfa0/raw/61d90b705617ba8070da80f8c97ac16376a9ca58/prometheus-example-app.yaml
  2. oc apply -f https://gist.githubusercontent.com/vikram-raj/86300d923a7a3a3a3348e359327e2307/raw/535d889923141a3f3e26e355d6bccec4650a0fcd/user-workload-config.yaml
  3. After applying the above 2 YAML it will create a rule and alert in ns1 namespace. But in local setup all alerts and rules will be visible so, filter by name CriticalAlert and to test this PR.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Sep 28, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1883200, 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.

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

In response to this:

Bug 1883200: fix silence toggle in devconsole monitoring

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.

@nemesis09
Copy link
Contributor

/retest

@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1883200, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.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 1883200: fix silence toggle in devconsole monitoring

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
Copy link
Member Author

/cc @invincibleJai

@nemesis09
Copy link
Contributor

/retest

// eslint-disable-next-line promise/no-nesting
coFetchJSON(`${ALERT_MANAGER_TENANCY_BASE_PATH}/api/v2/silences`)
.then((silences) => {
rule.silencedBy = _.filter(
Copy link
Contributor

@nemesis09 nemesis09 Oct 1, 2020

Choose a reason for hiding this comment

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

rule is a prop received by the component. ideally we should avoid modification of props. we could use a deep copy of the prop instead.

@vikram-raj vikram-raj force-pushed the odc-4423 branch 3 times, most recently from 4abdec3 to 5a9f1ad Compare October 1, 2020 07:14
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1883200, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.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 1883200: fix silence toggle in devconsole monitoring

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.

coFetchJSON.delete(`${alertManagerBaseURL}/api/v2/silence/${silence.id}`);
coFetchJSON
.delete(`${alertManagerBaseURL}/api/v2/silence/${silence.id}`)
.then(() => {
Copy link
Member

Choose a reason for hiding this comment

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

In the admin Console, after deleting a silence, we call refreshNotificationPollers, which immediately fetches the latest silences from Alertmanager and then triggers the evaluation of which alerts are silenced. I think that would achieve the same thing you are doing here in a simpler way.

};
setSilencing(true);
coFetchJSON
.post(`${ALERT_MANAGER_TENANCY_BASE_PATH}/api/v2/silences`, payload)
Copy link
Member

@kyoto kyoto Oct 1, 2020

Choose a reason for hiding this comment

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

Same comment as for the delete. In the admin Console, after creating a silence, we call refreshNotificationPollers to trigger a refresh of the alert's state, so I think we could do something similar 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.

Our scenario is a little different. In our case, we need to trigger the refresh for rules and silences. But in refreshNotificationPollers it is refreshing only silences.

Copy link
Member

Choose a reason for hiding this comment

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

I looked into this some more and I still think we can simplify the code here by using refreshNotificationPollers or a similar approach. However, I'm OK with addressing that with a follow up PR.

@nemesis09
Copy link
Contributor

/retest

@invincibleJai
Copy link
Member

@vikram-raj there is improvement with handling toggle component based on issue description, but i see some delay still in silences getting updated and user can toggle again meanwhile

Oct-02-2020 14-53-17

@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1883200, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.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 1883200: fix silence toggle in devconsole monitoring

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
Copy link
Member Author

@invincibleJai I tested it locally and in the cluster as well. And did not notice any delay.

Kapture 2020-10-02 at 16 26 47

@vikram-raj vikram-raj force-pushed the odc-4423 branch 3 times, most recently from 1dd7da5 to c03f2fd Compare October 2, 2020 13:25
@invincibleJai
Copy link
Member

invincibleJai commented Oct 2, 2020

/approve

Thanks @vikram-raj looks good now after the changes, verified it again. cc @kyoto

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 2, 2020
Copy link
Member

@jerolimov jerolimov left a comment

Choose a reason for hiding this comment

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

Tested it locally, works as expected.

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, jerolimov, 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-merge-robot openshift-merge-robot merged commit 076ecde into openshift:master Oct 2, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: All pull requests linked via external trackers have merged:

Bugzilla bug 1883200 has been moved to the MODIFIED state.

In response to this:

Bug 1883200: fix silence toggle in devconsole monitoring

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-4423 branch October 2, 2020 16:45
@spadgett spadgett added this to the v4.6 milestone Oct 5, 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/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. 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 lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants