Skip to content

Commit

Permalink
stop indexing severity value in uptime
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiota committed Dec 9, 2021
1 parent d9f436c commit 9b3ce8e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/
import {
ALERT_SEVERITY,
ALERT_EVALUATION_VALUE,
ALERT_EVALUATION_THRESHOLD,
ALERT_REASON,
Expand Down Expand Up @@ -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 ${
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions x-pack/plugins/uptime/server/lib/alerts/status_check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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}`),
};
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/uptime/server/lib/alerts/status_check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
});

Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/uptime/server/lib/alerts/tls.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}`,
});
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/uptime/server/lib/alerts/tls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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),
},
});
Expand Down

0 comments on commit 9b3ce8e

Please sign in to comment.