From a64b656a080d0d067aa9e3cc630865c3f20e5b75 Mon Sep 17 00:00:00 2001 From: mgiota Date: Wed, 18 Aug 2021 12:58:23 +0200 Subject: [PATCH] temporarily remove severity value occurences --- .../src/technical_field_names.ts | 7 +++---- ..._transaction_duration_anomaly_alert_type.ts | 8 ++++---- .../public/pages/alerts/example_data.ts | 18 +++++++++--------- .../server/lib/alerts/duration_anomaly.test.ts | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/packages/kbn-rule-data-utils/src/technical_field_names.ts b/packages/kbn-rule-data-utils/src/technical_field_names.ts index 95142adf52652..52edfc6c702a5 100644 --- a/packages/kbn-rule-data-utils/src/technical_field_names.ts +++ b/packages/kbn-rule-data-utils/src/technical_field_names.ts @@ -33,7 +33,7 @@ const ALERT_REASON = `${ALERT_NAMESPACE}.reason` as const; const ALERT_RISK_SCORE = `${ALERT_NAMESPACE}.risk_score` as const; const ALERT_SEVERITY = `${ALERT_NAMESPACE}.severity` as const; const ALERT_SEVERITY = `${ALERT_NAMESPACE}.severity.level` as const; -const ALERT_SEVERITY_VALUE = `${ALERT_NAMESPACE}.severity.value` as const; +// const ALERT_SEVERITY_VALUE = `${ALERT_NAMESPACE}.severity.value` as const; const ALERT_START = `${ALERT_NAMESPACE}.start` as const; const ALERT_STATUS = `${ALERT_NAMESPACE}.status` as const; const ALERT_SYSTEM_STATUS = `${ALERT_NAMESPACE}.system_status` as const; @@ -130,7 +130,7 @@ const fields = { ALERT_START, ALERT_SEVERITY, ALERT_SEVERITY, - ALERT_SEVERITY_VALUE, + // ALERT_SEVERITY_VALUE, ALERT_STATUS, ALERT_SYSTEM_STATUS, ALERT_UUID, @@ -186,8 +186,7 @@ export { ALERT_RULE_VERSION, ALERT_RULE_SEVERITY, ALERT_SEVERITY, - ALERT_SEVERITY, - ALERT_SEVERITY_VALUE, + // ALERT_SEVERITY_VALUE, ALERT_START, ALERT_SYSTEM_STATUS, ALERT_UUID, diff --git a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_anomaly_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_anomaly_alert_type.ts index 10bf3bb43ef86..9200bcd9b169e 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_anomaly_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_anomaly_alert_type.ts @@ -13,14 +13,14 @@ import type { ALERT_EVALUATION_THRESHOLD as ALERT_EVALUATION_THRESHOLD_TYPED, ALERT_EVALUATION_VALUE as ALERT_EVALUATION_VALUE_TYPED, ALERT_SEVERITY as ALERT_SEVERITY_TYPED, - ALERT_SEVERITY_VALUE as ALERT_SEVERITY_VALUE_TYPED, + // ALERT_SEVERITY_VALUE as ALERT_SEVERITY_VALUE_TYPED, ALERT_REASON as ALERT_REASON_TYPED, } from '@kbn/rule-data-utils'; import { ALERT_EVALUATION_THRESHOLD as ALERT_EVALUATION_THRESHOLD_NON_TYPED, ALERT_EVALUATION_VALUE as ALERT_EVALUATION_VALUE_NON_TYPED, ALERT_SEVERITY as ALERT_SEVERITY_NON_TYPED, - ALERT_SEVERITY_VALUE as ALERT_SEVERITY_VALUE_NON_TYPED, + // ALERT_SEVERITY_VALUE as ALERT_SEVERITY_VALUE_NON_TYPED, ALERT_REASON as ALERT_REASON_NON_TYPED, // @ts-expect-error } from '@kbn/rule-data-utils/target_node/technical_field_names'; @@ -52,7 +52,7 @@ import { const ALERT_EVALUATION_THRESHOLD: typeof ALERT_EVALUATION_THRESHOLD_TYPED = ALERT_EVALUATION_THRESHOLD_NON_TYPED; const ALERT_EVALUATION_VALUE: typeof ALERT_EVALUATION_VALUE_TYPED = ALERT_EVALUATION_VALUE_NON_TYPED; const ALERT_SEVERITY: typeof ALERT_SEVERITY_TYPED = ALERT_SEVERITY_NON_TYPED; -const ALERT_SEVERITY_VALUE: typeof ALERT_SEVERITY_VALUE_TYPED = ALERT_SEVERITY_VALUE_NON_TYPED; +// const ALERT_SEVERITY_VALUE: typeof ALERT_SEVERITY_VALUE_TYPED = ALERT_SEVERITY_VALUE_NON_TYPED; const ALERT_REASON: typeof ALERT_REASON_TYPED = ALERT_REASON_NON_TYPED; const paramsSchema = schema.object({ @@ -259,7 +259,7 @@ export function registerTransactionDurationAnomalyAlertType({ [TRANSACTION_TYPE]: transactionType, [PROCESSOR_EVENT]: ProcessorEvent.transaction, [ALERT_SEVERITY]: severityLevel, - [ALERT_SEVERITY_VALUE]: score, + // [ALERT_SEVERITY_VALUE]: score, [ALERT_EVALUATION_VALUE]: score, [ALERT_EVALUATION_THRESHOLD]: threshold, [ALERT_REASON]: formatTransactionDurationAnomalyReason({ diff --git a/x-pack/plugins/observability/public/pages/alerts/example_data.ts b/x-pack/plugins/observability/public/pages/alerts/example_data.ts index 60887d8531e16..8b28805d8afeb 100644 --- a/x-pack/plugins/observability/public/pages/alerts/example_data.ts +++ b/x-pack/plugins/observability/public/pages/alerts/example_data.ts @@ -10,7 +10,7 @@ import { ALERT_END, ALERT_ID, ALERT_SEVERITY, - ALERT_SEVERITY_VALUE, + // ALERT_SEVERITY_VALUE, ALERT_RULE_TYPE_ID, ALERT_START, ALERT_STATUS, @@ -130,14 +130,14 @@ export const dynamicIndexPattern = { aggregatable: true, readFromDocValues: true, }, - { - name: ALERT_SEVERITY_VALUE, - type: 'number', - esTypes: ['long'], - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, + // { + // name: 'ALERT_SEVERITY_VALUE', + // type: 'number', + // esTypes: ['long'], + // searchable: true, + // aggregatable: true, + // readFromDocValues: true, + // }, { name: ALERT_START, type: 'date', diff --git a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts index 16412b3d3f6e5..b0c4399bbd2c5 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/duration_anomaly.test.ts @@ -6,7 +6,7 @@ */ import { ALERT_SEVERITY, - ALERT_SEVERITY_VALUE, + // ALERT_SEVERITY_VALUE, ALERT_EVALUATION_VALUE, ALERT_EVALUATION_THRESHOLD, ALERT_REASON, @@ -172,7 +172,7 @@ describe('duration anomaly alert', () => { [ALERT_EVALUATION_VALUE]: anomaly.actualSort, [ALERT_EVALUATION_THRESHOLD]: anomaly.typicalSort, [ALERT_SEVERITY]: getSeverityType(anomaly.severity), - [ALERT_SEVERITY_VALUE]: anomaly.severity, + // [ALERT_SEVERITY_VALUE]: anomaly.severity, [ALERT_REASON]: `Abnormal (${getSeverityType( anomaly.severity )} level) response time detected on uptime-monitor with url ${