[Metrics UI] Disable recovery action scheduling (#87061)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
ab944b4af0
commit
6df7498a41
|
@ -24,7 +24,7 @@ import {
|
|||
buildErrorAlertReason,
|
||||
buildFiredAlertReason,
|
||||
buildNoDataAlertReason,
|
||||
buildRecoveredAlertReason,
|
||||
// buildRecoveredAlertReason,
|
||||
stateToAlertMessage,
|
||||
} from '../common/messages';
|
||||
import { evaluateCondition } from './evaluate_condition';
|
||||
|
@ -99,9 +99,14 @@ export const createInventoryMetricThresholdExecutor = (libs: InfraBackendLibs) =
|
|||
.map((result) => buildReasonWithVerboseMetricName(result[item], buildFiredAlertReason))
|
||||
.join('\n');
|
||||
} else if (nextState === AlertStates.OK && prevState?.alertState === AlertStates.ALERT) {
|
||||
reason = results
|
||||
.map((result) => buildReasonWithVerboseMetricName(result[item], buildRecoveredAlertReason))
|
||||
.join('\n');
|
||||
/*
|
||||
* Custom recovery actions aren't yet available in the alerting framework
|
||||
* Uncomment the code below once they've been implemented
|
||||
* Reference: https://github.com/elastic/kibana/issues/87048
|
||||
*/
|
||||
// reason = results
|
||||
// .map((result) => buildReasonWithVerboseMetricName(result[item], buildRecoveredAlertReason))
|
||||
// .join('\n');
|
||||
}
|
||||
if (alertOnNoData) {
|
||||
if (nextState === AlertStates.NO_DATA) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { createMetricThresholdExecutor, FIRED_ACTIONS } from './metric_threshold_executor';
|
||||
import { Comparator, AlertStates } from './types';
|
||||
import * as mocks from './test_mocks';
|
||||
import { RecoveredActionGroup } from '../../../../../alerts/common';
|
||||
// import { RecoveredActionGroup } from '../../../../../alerts/common';
|
||||
import {
|
||||
alertsMock,
|
||||
AlertServicesMock,
|
||||
|
@ -21,7 +21,7 @@ interface AlertTestInstance {
|
|||
state: any;
|
||||
}
|
||||
|
||||
let persistAlertInstances = false;
|
||||
let persistAlertInstances = false; // eslint-disable-line prefer-const
|
||||
|
||||
const mockOptions = {
|
||||
alertId: '',
|
||||
|
@ -366,6 +366,13 @@ describe('The metric threshold alert type', () => {
|
|||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* Custom recovery actions aren't yet available in the alerting framework
|
||||
* Uncomment the code below once they've been implemented
|
||||
* Reference: https://github.com/elastic/kibana/issues/87048
|
||||
*/
|
||||
|
||||
/*
|
||||
describe('querying a metric that later recovers', () => {
|
||||
const instanceID = '*';
|
||||
const execute = (threshold: number[]) =>
|
||||
|
@ -410,6 +417,7 @@ describe('The metric threshold alert type', () => {
|
|||
expect(getState(instanceID).alertState).toBe(AlertStates.OK);
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
describe('querying a metric with a percentage metric', () => {
|
||||
const instanceID = '*';
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
buildErrorAlertReason,
|
||||
buildFiredAlertReason,
|
||||
buildNoDataAlertReason,
|
||||
buildRecoveredAlertReason,
|
||||
// buildRecoveredAlertReason,
|
||||
stateToAlertMessage,
|
||||
} from '../common/messages';
|
||||
import { createFormatter } from '../../../../common/formatters';
|
||||
|
@ -77,9 +77,14 @@ export const createMetricThresholdExecutor = (
|
|||
.map((result) => buildFiredAlertReason(formatAlertResult(result[group])))
|
||||
.join('\n');
|
||||
} else if (nextState === AlertStates.OK && prevState?.alertState === AlertStates.ALERT) {
|
||||
reason = alertResults
|
||||
.map((result) => buildRecoveredAlertReason(formatAlertResult(result[group])))
|
||||
.join('\n');
|
||||
/*
|
||||
* Custom recovery actions aren't yet available in the alerting framework
|
||||
* Uncomment the code below once they've been implemented
|
||||
* Reference: https://github.com/elastic/kibana/issues/87048
|
||||
*/
|
||||
// reason = alertResults
|
||||
// .map((result) => buildRecoveredAlertReason(formatAlertResult(result[group])))
|
||||
// .join('\n');
|
||||
}
|
||||
if (alertOnNoData) {
|
||||
if (nextState === AlertStates.NO_DATA) {
|
||||
|
|
Loading…
Reference in a new issue