Skip to content

Commit

Permalink
[8.14] [DOCS] Fix docs and screenshots for rule creation changes (#18…
Browse files Browse the repository at this point in the history
…1925) (#182265)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[DOCS] Fix docs and screenshots for rule creation changes
(#181925)](#181925)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-05-01T16:18:17Z","message":"[DOCS]
Fix docs and screenshots for rule creation changes
(#181925)","sha":"06e147e021c2888a82d92705ef180441f1a55ce8","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Alerting/RulesManagement","v8.14.0","v8.15.0"],"title":"[DOCS]
Fix docs and screenshots for rule creation
changes","number":181925,"url":"https://github.com/elastic/kibana/pull/181925","mergeCommit":{"message":"[DOCS]
Fix docs and screenshots for rule creation changes
(#181925)","sha":"06e147e021c2888a82d92705ef180441f1a55ce8"}},"sourceBranch":"main","suggestedTargetBranches":["8.14"],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181925","number":181925,"mergeCommit":{"message":"[DOCS]
Fix docs and screenshots for rule creation changes
(#181925)","sha":"06e147e021c2888a82d92705ef180441f1a55ce8"}}]}]
BACKPORT-->

Co-authored-by: Lisa Cawley <[email protected]>
  • Loading branch information
kibanamachine and lcawl authored May 1, 2024
1 parent 63e53a3 commit 321eecb
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 53 deletions.
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/user/alerting/rule-types/es-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ The {es} query rule type runs a user-configured query, compares the number of
matches to a configured threshold, and schedules actions to run when the
threshold condition is met.

In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*, fill in the name and optional tags, then select *{es} query*.
In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*.
Select the *{es} query* rule type then fill in the name and optional tags.
An {es} query rule can be defined using {es} Query Domain Specific Language (DSL), {es} Query Language (ES|QL), {kib} Query Language (KQL), or Lucene.

[float]
Expand Down
3 changes: 2 additions & 1 deletion docs/user/alerting/rule-types/geo-rule-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

The tracking containment rule alerts when an entity is contained or no longer contained within a boundary.

In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*, fill in the name and optional tags, then select *Tracking containment*.
In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*.
Select the *Tracking containment* rule type then fill in the name and optional tags.

[float]
=== Define the conditions
Expand Down
13 changes: 5 additions & 8 deletions docs/user/alerting/rule-types/index-threshold.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

The index threshold rule type runs an {es} query. It aggregates field values from documents, compares them to threshold values, and schedules actions to run when the thresholds are met.

In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*, fill in the name and optional tags, then select *Index threshold*.
In *{stack-manage-app}* > *{rules-ui}*, click *Create rule*.
Select the *Index threshold* rule type then fill in the name and optional tags.

[float]
=== Define the conditions
Expand Down Expand Up @@ -107,15 +108,11 @@ You can also specify <<rule-action-variables,variables common to all rules>>.

In this example, you will use the {kib} <<add-sample-data,sample weblog data set>> to set up and tune the conditions on an index threshold rule. For this example, you want to detect when any of the top four sites serve more than 420,000 bytes over a 24 hour period.

. Open the main menu, then click *{stack-manage-app} > {rules-ui}*.
. Go to *{stack-manage-app} > {rules-ui}* and click *Create rule*.

. Create a new rule.
. Select the **Index threshold** rule type.

.. Provide a rule name and select the **Index threshold** rule type.
+
[role="screenshot"]
image::user/alerting/images/rule-types-index-threshold-select.png[Choosing an index threshold rule type]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.
.. Provide a rule name.

.. Select an index. Click *Index*, and set *Indices to query* to `kibana_sample_data_logs`. Set the *Time field* to `@timestamp`.
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ function createTestJobAndDatafeed() {
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const ml = getService('ml');
const pageObjects = getPageObjects(['triggersActionsUI']);
const pageObjects = getPageObjects(['triggersActionsUI', 'header']);
const commonScreenshots = getService('commonScreenshots');
const browser = getService('browser');
const actions = getService('actions');
const testSubjects = getService('testSubjects');

Expand Down Expand Up @@ -105,16 +104,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
it('alert flyout screenshots', async () => {
await ml.navigation.navigateToAlertsAndAction();
await pageObjects.triggersActionsUI.clickCreateAlertButton();
await ml.alerting.setRuleName('test-ecommerce');
const searchBox = await testSubjects.find('ruleSearchField');
await searchBox.click();
await searchBox.clearValue();
await searchBox.type('ml');
await searchBox.pressKeys(browser.keys.ENTER);
await ml.testExecution.logTestStep('take screenshot');
await commonScreenshots.takeScreenshot('ml-rule', screenshotDirectories, 1920, 1400);

await ml.testExecution.logTestStep('Create anomaly detection jobs health rule');
await ml.alerting.selectAnomalyDetectionJobHealthAlertType();
await pageObjects.header.waitUntilLoadingHasFinished();
await ml.alerting.setRuleName('test-ecommerce');
await ml.alerting.selectJobs([testJobId]);
await ml.testExecution.logTestStep('take screenshot');
await commonScreenshots.takeScreenshot(
Expand All @@ -137,9 +130,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
);
await ml.alerting.clickCancelSaveRuleButton();

await ml.testExecution.logTestStep('Create anomaly detection rule');
await pageObjects.triggersActionsUI.clickCreateAlertButton();
await ml.alerting.setRuleName('test-ecommerce');
await ml.alerting.selectAnomalyDetectionAlertType();
await pageObjects.header.waitUntilLoadingHasFinished();
await ml.alerting.setRuleName('test-ecommerce');
await ml.testExecution.logTestStep('should have correct default values');
await ml.alerting.assertSeverity(75);
await ml.alerting.assertPreviewButtonState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
await rules.common.clickCreateAlertButton();
await testSubjects.setValue('ruleNameInput', ruleName);
await testSubjects.click(`.es-query-SelectOption`);
await pageObjects.header.waitUntilLoadingHasFinished();
await testSubjects.setValue('ruleNameInput', ruleName);
await testSubjects.click('queryFormType_esQuery');
const indexSelector = await testSubjects.find('selectIndexExpression');
await indexSelector.click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
await rules.common.clickCreateAlertButton();
await testSubjects.setValue('ruleNameInput', ruleName);
await testSubjects.click('tagsComboBox');
await testSubjects.setValue('tagsComboBox', 'sample-data');
await testSubjects.click('solutionsFilterButton');
await testSubjects.click('solutionstackAlertsFilterOption');
await testSubjects.setValue('solutionsFilterButton', 'solutionstackAlertsFilterOption');
await commonScreenshots.takeScreenshot(
'rule-types-index-threshold-select',
screenshotDirectories,
1400,
1024
);

await testSubjects.click('.index-threshold-SelectOption');
await pageObjects.header.waitUntilLoadingHasFinished();
await commonScreenshots.takeScreenshot(
'rule-types-index-threshold-conditions',
screenshotDirectories,
1400,
1300
);

await testSubjects.setValue('ruleNameInput', ruleName);
await testSubjects.click('tagsComboBox');
await testSubjects.setValue('tagsComboBox', 'sample-data');
await testSubjects.scrollIntoView('selectIndexExpression');
await testSubjects.click('selectIndexExpression');
await comboBox.set('thresholdIndexesComboBox', 'kibana_sample_data_logs ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await pageObjects.common.navigateToApp('triggersActions');
await pageObjects.header.waitUntilLoadingHasFinished();
await rules.common.clickCreateAlertButton();
await testSubjects.click('solutionsFilterButton');
await testSubjects.click('solutionstackAlertsFilterOption');
await testSubjects.setValue('solutionsFilterButton', 'solutionstackAlertsFilterOption');
await testSubjects.click('.geo-containment-SelectOption');
await pageObjects.header.waitUntilLoadingHasFinished();
await comboBox.setCustom('entitiesDataView', 'Kibana Sample Data Logs');
await commonScreenshots.takeScreenshot(
'alert-types-tracking-containment-conditions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const transform = getService('transform');
const screenshotDirectories = ['transform_docs'];
const pageObjects = getPageObjects(['triggersActionsUI']);
const pageObjects = getPageObjects(['triggersActionsUI', 'header']);

let testTransformId = '';

Expand All @@ -37,20 +37,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
await transform.testExecution.logTestStep('navigate to stack management rules');
await transform.navigation.navigateToRules();
await pageObjects.triggersActionsUI.clickCreateAlertButton();
await transform.alerting.setRuleName('transform-health-rule');

await transform.testExecution.logTestStep(
'search for transform rule type and take screenshot'
);
const searchBox = await testSubjects.find('ruleSearchField');
await searchBox.click();
await searchBox.clearValue();
await searchBox.type('transform');
await searchBox.pressKeys(browser.keys.ENTER);
await commonScreenshots.takeScreenshot('transform-rule', screenshotDirectories);

await pageObjects.header.waitUntilLoadingHasFinished();
await transform.testExecution.logTestStep('select transform details and take screenshot');
await transform.alerting.selectTransformAlertType();
await transform.alerting.setRuleName('transform-health-rule');
testTransformId = '*';
await transform.alerting.selectTransforms([testTransformId]);
await commonScreenshots.takeScreenshot('transform-check-config', screenshotDirectories);
Expand Down

0 comments on commit 321eecb

Please sign in to comment.