stop indexing severity value in uptime (#120873)

This commit is contained in:
mgiota 2021-12-09 15:04:21 +01:00 committed by GitHub
parent 6d732a1a8b
commit f14540ff63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 13 deletions

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import {
ALERT_SEVERITY,
ALERT_EVALUATION_VALUE,
ALERT_EVALUATION_THRESHOLD,
ALERT_REASON,
@ -170,7 +169,6 @@ describe('duration anomaly alert', () => {
'observer.geo.name': anomaly.entityValue,
[ALERT_EVALUATION_VALUE]: anomaly.actualSort,
[ALERT_EVALUATION_THRESHOLD]: anomaly.typicalSort,
[ALERT_SEVERITY]: getSeverityType(anomaly.severity),
[ALERT_REASON]: `Abnormal (${getSeverityType(
anomaly.severity
)} level) response time detected on uptime-monitor with url ${

View file

@ -8,7 +8,6 @@ import { KibanaRequest, SavedObjectsClientContract } from 'kibana/server';
import moment from 'moment';
import { schema } from '@kbn/config-schema';
import {
ALERT_SEVERITY,
ALERT_EVALUATION_VALUE,
ALERT_EVALUATION_THRESHOLD,
ALERT_REASON,
@ -134,7 +133,6 @@ export const durationAnomalyAlertFactory: UptimeAlertTypeFactory<ActionGroupIds>
'anomaly.bucket_span.minutes': summary.bucketSpan,
[ALERT_EVALUATION_VALUE]: anomaly.actualSort,
[ALERT_EVALUATION_THRESHOLD]: anomaly.typicalSort,
[ALERT_SEVERITY]: summary.severity,
[ALERT_REASON]: generateAlertMessage(
CommonDurationAnomalyTranslations.defaultActionMessage,
summary

View file

@ -4,7 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { ALERT_REASON, ALERT_SEVERITY_WARNING, ALERT_SEVERITY } from '@kbn/rule-data-utils';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import {
generateFilterDSL,
hasFilters,
@ -75,7 +75,6 @@ const mockStatusAlertDocument = (
[ALERT_REASON]: `Monitor first with url ${monitorInfo?.url?.full} is down from ${
monitorInfo.observer?.geo?.name
}. The latest error message is ${monitorInfo.error?.message || ''}`,
[ALERT_SEVERITY]: ALERT_SEVERITY_WARNING,
},
id: getInstanceId(
monitorInfo,
@ -96,7 +95,6 @@ const mockAvailabilityAlertDocument = (monitor: GetMonitorAvailabilityResult) =>
)}% availability expected is 99.34% from ${
monitorInfo.observer?.geo?.name
}. The latest error message is ${monitorInfo.error?.message || ''}`,
[ALERT_SEVERITY]: ALERT_SEVERITY_WARNING,
},
id: getInstanceId(monitorInfo, `${monitorInfo?.monitor.id}-${monitorInfo.observer?.geo?.name}`),
};

View file

@ -7,7 +7,6 @@
import { min } from 'lodash';
import datemath from '@elastic/datemath';
import { schema } from '@kbn/config-schema';
import { ALERT_SEVERITY_WARNING, ALERT_SEVERITY } from '@kbn/rule-data-utils';
import { i18n } from '@kbn/i18n';
import { JsonObject } from '@kbn/utility-types';
import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query';
@ -159,7 +158,6 @@ export const getMonitorAlertDocument = (monitorSummary: Record<string, string |
'observer.geo.name': monitorSummary.observerLocation,
'error.message': monitorSummary.latestErrorMessage,
'agent.name': monitorSummary.observerHostname,
[ALERT_SEVERITY]: ALERT_SEVERITY_WARNING,
[ALERT_REASON]: monitorSummary.reason,
});

View file

@ -5,7 +5,6 @@
* 2.0.
*/
import moment from 'moment';
import { ALERT_SEVERITY_WARNING, ALERT_SEVERITY } from '@kbn/rule-data-utils';
import { tlsAlertFactory, getCertSummary } from './tls';
import { TLS } from '../../../common/constants/alerts';
import { CertResult, DynamicSettings } from '../../../common/runtime_types';
@ -115,7 +114,6 @@ describe('tls alert', () => {
'tls.server.x509.not_after': cert.not_after,
'tls.server.x509.not_before': cert.not_before,
'tls.server.hash.sha256': cert.sha256,
[ALERT_SEVERITY]: ALERT_SEVERITY_WARNING,
}),
id: `${cert.common_name}-${cert.issuer?.replace(/\s/g, '_')}-${cert.sha256}`,
});

View file

@ -6,7 +6,7 @@
*/
import moment from 'moment';
import { schema } from '@kbn/config-schema';
import { ALERT_REASON, ALERT_SEVERITY_WARNING, ALERT_SEVERITY } from '@kbn/rule-data-utils';
import { ALERT_REASON } from '@kbn/rule-data-utils';
import { UptimeAlertTypeFactory } from './types';
import { updateState, generateAlertMessage } from './common';
import { TLS } from '../../../common/constants/alerts';
@ -167,7 +167,6 @@ export const tlsAlertFactory: UptimeAlertTypeFactory<ActionGroupIds> = (_server,
'tls.server.x509.not_after': cert.not_after,
'tls.server.x509.not_before': cert.not_before,
'tls.server.hash.sha256': cert.sha256,
[ALERT_SEVERITY]: ALERT_SEVERITY_WARNING,
[ALERT_REASON]: generateAlertMessage(TlsTranslations.defaultActionMessage, summary),
},
});