Skip to content

Commit

Permalink
[8.12] [RAM][[Maintenance Window][DOCS] Maintenance window scoped que…
Browse files Browse the repository at this point in the history
…ry automated screenshots (elastic#174315) (elastic#174872)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[RAM][[Maintenance Window][DOCS] Maintenance window scoped query
automated screenshots
(elastic#174315)](elastic#174315)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-15T21:22:33Z","message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(elastic#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","docs","Feature:Alerting/RulesManagement","v8.12.1","v8.13.0"],"number":174315,"url":"https://github.com/elastic/kibana/pull/174315","mergeCommit":{"message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(elastic#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174315","number":174315,"mergeCommit":{"message":"[RAM][[Maintenance
Window][DOCS] Maintenance window scoped query automated screenshots
(elastic#174315)","sha":"02ea9192f7181e7054266462be1273ab1431abaf"}}]}]
BACKPORT-->
  • Loading branch information
lcawl authored Jan 16, 2024
1 parent 81ca1e2 commit 7dc7791
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion docs/management/maintenance-windows/maintenance-windows.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When the alert recovers, there are no notifications--even if the recovery occurs
To use maintenance windows, you must have the appropriate {subscriptions}[subscription] and {kib} feature privileges.

- To have full access to maintenance windows, you must have `All` privileges for the *Management > Maintenance Windows* feature.
- To have view-only access to maintenance windows, you must have `Read` privileges for the **Management > Maintenance Windows* feature.
- To have view-only access to maintenance windows, you must have `Read` privileges for the *Management > Maintenance Windows* feature.

For more details, refer to <<kibana-privileges>>.

Expand All @@ -46,6 +46,18 @@ By default, maintenance windows affect all categories of rules.
The category-specific maintenance window options alter this behavior.
For the definitive list of rule types in each category, refer to the <<list-rule-types-api,get rule types API>>.

If you turn on *Filter alerts*, you can use KQL to filter the alerts affected by the maintenance window:

[role="screenshot"]
image::images/create-maintenance-window-filter.png[The Create Maintenance Window user interface in {kib} with alert filters turned on]
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

[NOTE]
====
* You can select only a single category when you turn on filters.
* Some rules are not affected by maintenance window filters because their alerts do not contain requisite data. In particular, <<kibana-alerts,{stack-monitor-app}>>, <<geo-alerting,tracking containment>>, {ml-docs}/ml-configuring-alerts.html[{anomaly-jobs} health], and {ref}/transform-alerts.html[transform health] rules are not affected by the filters.
====

A maintenance window can have any one of the following statuses:

- `Upcoming`: It will run at the scheduled date and time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'create-maintenance-window',
screenshotDirectories,
1400,
1024
1600
);
const filterAlerts = await find.byCssSelector(
'[data-test-subj="maintenanceWindowScopedQuerySwitch"] .euiSwitch__button'
);
await filterAlerts.click();
await commonScreenshots.takeScreenshot(
'create-maintenance-window-filter',
screenshotDirectories,
1400,
1600
);
const cancelButton = await testSubjects.find('cancelMaintenanceWindow');
await cancelButton.click();
Expand Down
3 changes: 3 additions & 0 deletions x-pack/test_serverless/functional/config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ export function createTestConfig(options: CreateTestConfigOptions) {
pathname: '/app/discover',
hash: '/context',
},
maintenanceWindows: {
pathname: '/app/management/insightsAndAlerting/maintenanceWindows',
},
},
// choose where screenshots should be saved
screenshots: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {

loadTestFile(require.resolve('./cases'));
loadTestFile(require.resolve('./connectors'));
loadTestFile(require.resolve('./maintenance_windows'));
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrProviderContext } from '../../../../../ftr_provider_context';

export default function ({ getPageObjects, getService }: FtrProviderContext) {
const pageObjects = getPageObjects(['common', 'header', 'svlCommonPage']);
const svlCommonScreenshots = getService('svlCommonScreenshots');
const screenshotDirectories = ['response_ops_docs', 'observability_maintenace_windows'];
const find = getService('find');
const testSubjects = getService('testSubjects');

describe('create window', function () {
beforeEach(async () => {
await pageObjects.svlCommonPage.login();
});

after(async () => {
await pageObjects.svlCommonPage.forceLogout();
});

it('create maintenance window screenshot', async () => {
await pageObjects.common.navigateToApp('maintenanceWindows');
await pageObjects.header.waitUntilLoadingHasFinished();
const createButton = await find.byCssSelector(
'[data-test-subj="mw-empty-prompt"] .euiButton'
);
await createButton.click();
await svlCommonScreenshots.takeScreenshot(
'create-maintenance-window',
screenshotDirectories,
1400,
1600
);
const filterAlerts = await find.byCssSelector(
'[data-test-subj="maintenanceWindowScopedQuerySwitch"] .euiSwitch__button'
);
await filterAlerts.click();
const radioGroup = await testSubjects.find('maintenanceWindowCategorySelectionRadioGroup');
const label = await radioGroup.findByCssSelector(`label[for="observability"]`);
await label.click();
await testSubjects.setValue('queryInput', 'kibana.alert.rule.name: custom-threshold-rule-1');
await svlCommonScreenshots.takeScreenshot(
'create-maintenance-window-filter',
screenshotDirectories,
1400,
1600
);
const cancelButton = await testSubjects.find('cancelMaintenanceWindow');
await cancelButton.click();
});
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { FtrProviderContext } from '../../../../../ftr_provider_context';

export default function ({ loadTestFile, getService }: FtrProviderContext) {
const browser = getService('browser');

describe('observability maintenance windows', function () {
before(async () => {
await browser.setWindowSize(1920, 1080);
});

loadTestFile(require.resolve('./create_window'));
});
}

0 comments on commit 7dc7791

Please sign in to comment.