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

[Response Ops][Flapping] Rule Specific Flapping - Allow rule specific flapping to be created and updated #190018

Closed
JiaweiWu opened this issue Aug 7, 2024 · 1 comment
Assignees
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.16.0

Comments

@JiaweiWu
Copy link
Contributor

JiaweiWu commented Aug 7, 2024

Parent Issue: https:/elastic/response-ops-team/issues/208

Implement the ability to create and update rules with rule specific flapping setting. This includes all of the schema and validation changes required to make this happen.

Requirements:

  • User can create a rule with flapping
  • User can update a rule with flapping
  • User should not be able to create a rule with flapping if global flapping is disabled
  • User should not be able to update a rule with flapping if global flapping is disabled
  • Flapping should be validated
@JiaweiWu JiaweiWu added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.16.0 labels Aug 7, 2024
@JiaweiWu JiaweiWu self-assigned this Aug 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@JiaweiWu JiaweiWu changed the title [Response Ops][Flapping] Allow rule specific flapping to be created and updated [Response Ops][Flapping] Rule Specific Flapping - Allow rule specific flapping to be created and updated Aug 7, 2024
JiaweiWu added a commit that referenced this issue Oct 9, 2024
…hanges (#190019)

## Summary
Issue: #190018

Implement rule specific flapping support for create and update Rule API.
The new property on the rule is named `flapping`;

```
flapping: {
  look_back_window: number;
  status_change_threshold: number;
}
```

Also make changes in the task runner to use the rule's flapping settings
if it exists. Otherwise use the global flapping setting.

# To test
1. Go to
`x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts`
and turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true`
2. Create a rule with a rule specific flapping setting, generate the
alert and let it flap
3. Assert that the flapping is now using the rule specific flapping
4. Turn space flapping off
5. Assert that it no longer flaps despite having a rule specific
flapping
6. Try deleting/adding back the rule specific flapping via the UI and
verify everything works.

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Oct 9, 2024
…hanges (elastic#190019)

## Summary
Issue: elastic#190018

Implement rule specific flapping support for create and update Rule API.
The new property on the rule is named `flapping`;

```
flapping: {
  look_back_window: number;
  status_change_threshold: number;
}
```

Also make changes in the task runner to use the rule's flapping settings
if it exists. Otherwise use the global flapping setting.

# To test
1. Go to
`x-pack/plugins/triggers_actions_ui/public/common/constants/index.ts`
and turn `IS_RULE_SPECIFIC_FLAPPING_ENABLED` to `true`
2. Create a rule with a rule specific flapping setting, generate the
alert and let it flap
3. Assert that the flapping is now using the rule specific flapping
4. Turn space flapping off
5. Assert that it no longer flaps despite having a rule specific
flapping
6. Try deleting/adding back the rule specific flapping via the UI and
verify everything works.

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit edd61f6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.16.0
Projects
None yet
Development

No branches or pull requests

3 participants