From eb43158bddf1a8501de4978526e3d7eceab8a378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20C=C3=B4t=C3=A9?= Date: Tue, 3 Nov 2020 14:09:41 -0500 Subject: [PATCH] Add descriptions to alert types (#81850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Initial attempt at adding descriptions to alert types * Fix typecheck failures * Fix i18n check * Fix failing jest test * Fix i18n check again * Apply changes for Uptime * Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts Co-authored-by: Casper Hübertz * Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts Co-authored-by: Casper Hübertz * Fix jest test * Update geo threshold description * Update description of some alert types based on feedback from Gail * Update description of some alert types based on feedback from Gail * Fix i18n * Fix i18n * Fix ESLint * Update some copy * Update uptime alert description * Fix typos Co-authored-by: Casper Hübertz --- .../public/alert_types/always_firing.tsx | 1 + .../public/alert_types/astros.tsx | 1 + .../alerting/register_apm_alerts.ts | 25 +++++++++++ .../infra/public/alerting/inventory/index.ts | 3 ++ .../log_threshold/log_threshold_alert_type.ts | 3 ++ .../public/alerting/metric_threshold/index.ts | 3 ++ x-pack/plugins/monitoring/common/constants.ts | 41 +++++++++++++++++++ .../cpu_usage_alert/cpu_usage_alert.tsx | 1 + .../public/alerts/disk_usage_alert/index.tsx | 1 + .../alerts/legacy_alert/legacy_alert.tsx | 1 + .../alerts/memory_usage_alert/index.tsx | 1 + .../missing_monitoring_data_alert.tsx | 1 + .../thread_pool_rejections_alert/index.tsx | 2 + .../monitoring/server/alerts/base_alert.ts | 1 + .../server/alerts/cluster_health_alert.ts | 1 + .../server/alerts/cpu_usage_alert.ts | 1 + .../server/alerts/disk_usage_alert.ts | 1 + .../elasticsearch_version_mismatch_alert.ts | 1 + .../alerts/kibana_version_mismatch_alert.ts | 1 + .../server/alerts/license_expiration_alert.ts | 1 + .../alerts/logstash_version_mismatch_alert.ts | 1 + .../server/alerts/memory_usage_alert.ts | 1 + .../alerts/missing_monitoring_data_alert.ts | 1 + .../server/alerts/nodes_changed_alert.ts | 1 + .../geo_threshold/index.ts | 3 ++ .../builtin_alert_types/threshold/index.ts | 8 +++- .../sections/alert_form/alert_add.test.tsx | 1 + .../sections/alert_form/alert_edit.test.tsx | 1 + .../sections/alert_form/alert_form.test.tsx | 4 ++ .../components/alerts_list.test.tsx | 1 + .../public/application/type_registry.test.ts | 1 + .../triggers_actions_ui/public/types.ts | 1 + x-pack/plugins/uptime/common/translations.ts | 3 ++ .../__tests__/monitor_status.test.ts | 1 + .../lib/alert_types/duration_anomaly.tsx | 3 +- .../public/lib/alert_types/monitor_status.tsx | 3 +- .../uptime/public/lib/alert_types/tls.tsx | 3 +- .../public/lib/alert_types/translations.ts | 6 +++ .../fixtures/plugins/alerts/public/plugin.ts | 2 + 39 files changed, 132 insertions(+), 4 deletions(-) diff --git a/x-pack/examples/alerting_example/public/alert_types/always_firing.tsx b/x-pack/examples/alerting_example/public/alert_types/always_firing.tsx index 839669bda109..9c420f4425d0 100644 --- a/x-pack/examples/alerting_example/public/alert_types/always_firing.tsx +++ b/x-pack/examples/alerting_example/public/alert_types/always_firing.tsx @@ -20,6 +20,7 @@ export function getAlertType(): AlertTypeModel { return { id: 'example.always-firing', name: 'Always Fires', + description: 'Alert when called', iconClass: 'bolt', alertParamsExpression: AlwaysFiringExpression, validate: (alertParams: AlwaysFiringParamsProps['alertParams']) => { diff --git a/x-pack/examples/alerting_example/public/alert_types/astros.tsx b/x-pack/examples/alerting_example/public/alert_types/astros.tsx index 4f894cfe231c..343f6b10ef85 100644 --- a/x-pack/examples/alerting_example/public/alert_types/astros.tsx +++ b/x-pack/examples/alerting_example/public/alert_types/astros.tsx @@ -45,6 +45,7 @@ export function getAlertType(): AlertTypeModel { return { id: 'example.people-in-space', name: 'People Are In Space Right Now', + description: 'Alert when people are in space right now', iconClass: 'globe', alertParamsExpression: PeopleinSpaceExpression, validate: (alertParams: PeopleinSpaceParamsProps['alertParams']) => { diff --git a/x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts b/x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts index 7995b1d38170..0eeb31927b2f 100644 --- a/x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts +++ b/x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts @@ -17,6 +17,10 @@ export function registerApmAlerts( name: i18n.translate('xpack.apm.alertTypes.errorCount', { defaultMessage: 'Error count threshold', }), + description: i18n.translate('xpack.apm.alertTypes.errorCount.description', { + defaultMessage: + 'Alert when the number of errors in a service exceeds a defined threshold.', + }), iconClass: 'bell', alertParamsExpression: lazy(() => import('./ErrorCountAlertTrigger')), validate: () => ({ @@ -41,6 +45,13 @@ export function registerApmAlerts( name: i18n.translate('xpack.apm.alertTypes.transactionDuration', { defaultMessage: 'Transaction duration threshold', }), + description: i18n.translate( + 'xpack.apm.alertTypes.transactionDuration.description', + { + defaultMessage: + 'Alert when the duration of a specific transaction type in a service exceeds a defined threshold.', + } + ), iconClass: 'bell', alertParamsExpression: lazy( () => import('./TransactionDurationAlertTrigger') @@ -68,6 +79,13 @@ export function registerApmAlerts( name: i18n.translate('xpack.apm.alertTypes.transactionErrorRate', { defaultMessage: 'Transaction error rate threshold', }), + description: i18n.translate( + 'xpack.apm.alertTypes.transactionErrorRate.description', + { + defaultMessage: + 'Alert when the rate of transaction errors in a service exceeds a defined threshold.', + } + ), iconClass: 'bell', alertParamsExpression: lazy( () => import('./TransactionErrorRateAlertTrigger') @@ -95,6 +113,13 @@ export function registerApmAlerts( name: i18n.translate('xpack.apm.alertTypes.transactionDurationAnomaly', { defaultMessage: 'Transaction duration anomaly', }), + description: i18n.translate( + 'xpack.apm.alertTypes.transactionDurationAnomaly.description', + { + defaultMessage: + 'Alert when the overall transaction duration of a service is considered anomalous.', + } + ), iconClass: 'bell', alertParamsExpression: lazy( () => import('./TransactionDurationAnomalyAlertTrigger') diff --git a/x-pack/plugins/infra/public/alerting/inventory/index.ts b/x-pack/plugins/infra/public/alerting/inventory/index.ts index b5f6e17cc2a1..b49465db0513 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/index.ts +++ b/x-pack/plugins/infra/public/alerting/inventory/index.ts @@ -17,6 +17,9 @@ export function createInventoryMetricAlertType(): AlertTypeModel { name: i18n.translate('xpack.infra.metrics.inventory.alertFlyout.alertName', { defaultMessage: 'Inventory', }), + description: i18n.translate('xpack.infra.metrics.inventory.alertFlyout.alertDescription', { + defaultMessage: 'Alert when the inventory exceeds a defined threshold.', + }), iconClass: 'bell', alertParamsExpression: React.lazy(() => import('./components/expression')), validate: validateMetricThreshold, diff --git a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts index 29a58fc95f2b..2e4cb2a53b6b 100644 --- a/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts +++ b/x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts @@ -15,6 +15,9 @@ export function getAlertType(): AlertTypeModel { name: i18n.translate('xpack.infra.logs.alertFlyout.alertName', { defaultMessage: 'Log threshold', }), + description: i18n.translate('xpack.infra.logs.alertFlyout.alertDescription', { + defaultMessage: 'Alert when the log aggregation exceeds the threshold.', + }), iconClass: 'bell', alertParamsExpression: React.lazy(() => import('./components/expression_editor/editor')), validate: validateExpression, diff --git a/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts b/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts index 6a999a86c99d..a48837792a3c 100644 --- a/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts +++ b/x-pack/plugins/infra/public/alerting/metric_threshold/index.ts @@ -17,6 +17,9 @@ export function createMetricThresholdAlertType(): AlertTypeModel { name: i18n.translate('xpack.infra.metrics.alertFlyout.alertName', { defaultMessage: 'Metric threshold', }), + description: i18n.translate('xpack.infra.metrics.alertFlyout.alertDescription', { + defaultMessage: 'Alert when the metrics aggregation exceeds the threshold.', + }), iconClass: 'bell', alertParamsExpression: React.lazy(() => import('./components/expression')), validate: validateMetricThreshold, diff --git a/x-pack/plugins/monitoring/common/constants.ts b/x-pack/plugins/monitoring/common/constants.ts index 355390100ac2..8d1ffc89f5dd 100644 --- a/x-pack/plugins/monitoring/common/constants.ts +++ b/x-pack/plugins/monitoring/common/constants.ts @@ -260,31 +260,52 @@ export const LEGACY_ALERT_DETAILS = { label: i18n.translate('xpack.monitoring.alerts.clusterHealth.label', { defaultMessage: 'Cluster health', }), + description: i18n.translate('xpack.monitoring.alerts.clusterHealth.description', { + defaultMessage: 'Alert when the health of the cluster changes.', + }), }, [ALERT_ELASTICSEARCH_VERSION_MISMATCH]: { label: i18n.translate('xpack.monitoring.alerts.elasticsearchVersionMismatch.label', { defaultMessage: 'Elasticsearch version mismatch', }), + description: i18n.translate( + 'xpack.monitoring.alerts.elasticsearchVersionMismatch.description', + { + defaultMessage: 'Alert when the cluster has multiple versions of Elasticsearch.', + } + ), }, [ALERT_KIBANA_VERSION_MISMATCH]: { label: i18n.translate('xpack.monitoring.alerts.kibanaVersionMismatch.label', { defaultMessage: 'Kibana version mismatch', }), + description: i18n.translate('xpack.monitoring.alerts.kibanaVersionMismatch.description', { + defaultMessage: 'Alert when the cluser has multiple versions of Kibana.', + }), }, [ALERT_LICENSE_EXPIRATION]: { label: i18n.translate('xpack.monitoring.alerts.licenseExpiration.label', { defaultMessage: 'License expiration', }), + description: i18n.translate('xpack.monitoring.alerts.licenseExpiration.description', { + defaultMessage: 'Alert when the cluster license is about to expire.', + }), }, [ALERT_LOGSTASH_VERSION_MISMATCH]: { label: i18n.translate('xpack.monitoring.alerts.logstashVersionMismatch.label', { defaultMessage: 'Logstash version mismatch', }), + description: i18n.translate('xpack.monitoring.alerts.logstashVersionMismatch.description', { + defaultMessage: 'Alert when the cluster has multiple versions of Logstash.', + }), }, [ALERT_NODES_CHANGED]: { label: i18n.translate('xpack.monitoring.alerts.nodesChanged.label', { defaultMessage: 'Nodes changed', }), + description: i18n.translate('xpack.monitoring.alerts.nodesChanged.description', { + defaultMessage: 'Alert when adding, removing, or restarting a node.', + }), }, }; @@ -296,6 +317,9 @@ export const ALERT_DETAILS = { label: i18n.translate('xpack.monitoring.alerts.cpuUsage.label', { defaultMessage: 'CPU Usage', }), + description: i18n.translate('xpack.monitoring.alerts.cpuUsage.description', { + defaultMessage: 'Alert when the CPU load for a node is consistently high.', + }), paramDetails: { threshold: { label: i18n.translate('xpack.monitoring.alerts.cpuUsage.paramDetails.threshold.label', { @@ -329,6 +353,9 @@ export const ALERT_DETAILS = { label: i18n.translate('xpack.monitoring.alerts.diskUsage.label', { defaultMessage: 'Disk Usage', }), + description: i18n.translate('xpack.monitoring.alerts.diskUsage.description', { + defaultMessage: 'Alert when the disk usage for a node is consistently high.', + }), }, [ALERT_MEMORY_USAGE]: { paramDetails: { @@ -348,6 +375,9 @@ export const ALERT_DETAILS = { label: i18n.translate('xpack.monitoring.alerts.memoryUsage.label', { defaultMessage: 'Memory Usage (JVM)', }), + description: i18n.translate('xpack.monitoring.alerts.memoryUsage.description', { + defaultMessage: 'Alert when a node reports high memory usage.', + }), }, [ALERT_MISSING_MONITORING_DATA]: { paramDetails: { @@ -367,6 +397,9 @@ export const ALERT_DETAILS = { label: i18n.translate('xpack.monitoring.alerts.missingData.label', { defaultMessage: 'Missing monitoring data', }), + description: i18n.translate('xpack.monitoring.alerts.missingData.description', { + defaultMessage: 'Alert when monitoring data is missing.', + }), }, [ALERT_THREAD_POOL_SEARCH_REJECTIONS]: { paramDetails: { @@ -388,6 +421,10 @@ export const ALERT_DETAILS = { defaultMessage: 'Thread pool {type} rejections', values: { type: 'search' }, }), + description: i18n.translate('xpack.monitoring.alerts.searchThreadPoolRejections.description', { + defaultMessage: + 'Alert when the number of rejections in the search thread pool exceeds the threshold.', + }), }, [ALERT_THREAD_POOL_WRITE_REJECTIONS]: { paramDetails: { @@ -409,6 +446,10 @@ export const ALERT_DETAILS = { defaultMessage: 'Thread pool {type} rejections', values: { type: 'write' }, }), + description: i18n.translate('xpack.monitoring.alerts.writeThreadPoolRejections.description', { + defaultMessage: + 'Alert when the number of rejections in the write thread pool exceeds the threshold.', + }), }, }; diff --git a/x-pack/plugins/monitoring/public/alerts/cpu_usage_alert/cpu_usage_alert.tsx b/x-pack/plugins/monitoring/public/alerts/cpu_usage_alert/cpu_usage_alert.tsx index d15fe6344ec0..11ba8214ff81 100644 --- a/x-pack/plugins/monitoring/public/alerts/cpu_usage_alert/cpu_usage_alert.tsx +++ b/x-pack/plugins/monitoring/public/alerts/cpu_usage_alert/cpu_usage_alert.tsx @@ -14,6 +14,7 @@ export function createCpuUsageAlertType(): AlertTypeModel { return { id: ALERT_CPU_USAGE, name: ALERT_DETAILS[ALERT_CPU_USAGE].label, + description: ALERT_DETAILS[ALERT_CPU_USAGE].description, iconClass: 'bell', alertParamsExpression: (props: Props) => ( diff --git a/x-pack/plugins/monitoring/public/alerts/disk_usage_alert/index.tsx b/x-pack/plugins/monitoring/public/alerts/disk_usage_alert/index.tsx index 589b374cae32..7c44e37904ec 100644 --- a/x-pack/plugins/monitoring/public/alerts/disk_usage_alert/index.tsx +++ b/x-pack/plugins/monitoring/public/alerts/disk_usage_alert/index.tsx @@ -16,6 +16,7 @@ export function createDiskUsageAlertType(): AlertTypeModel { return { id: ALERT_DISK_USAGE, name: ALERT_DETAILS[ALERT_DISK_USAGE].label, + description: ALERT_DETAILS[ALERT_DISK_USAGE].description, iconClass: 'bell', alertParamsExpression: (props: Props) => ( diff --git a/x-pack/plugins/monitoring/public/alerts/legacy_alert/legacy_alert.tsx b/x-pack/plugins/monitoring/public/alerts/legacy_alert/legacy_alert.tsx index 83201b0512db..ca7af2fe64e7 100644 --- a/x-pack/plugins/monitoring/public/alerts/legacy_alert/legacy_alert.tsx +++ b/x-pack/plugins/monitoring/public/alerts/legacy_alert/legacy_alert.tsx @@ -16,6 +16,7 @@ export function createLegacyAlertTypes(): AlertTypeModel[] { return { id: legacyAlert, name: LEGACY_ALERT_DETAILS[legacyAlert].label, + description: LEGACY_ALERT_DETAILS[legacyAlert].description, iconClass: 'bell', alertParamsExpression: () => ( diff --git a/x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx b/x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx index d3d48d907d02..14fb7147179c 100644 --- a/x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx +++ b/x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx @@ -16,6 +16,7 @@ export function createMemoryUsageAlertType(): AlertTypeModel { return { id: ALERT_MEMORY_USAGE, name: ALERT_DETAILS[ALERT_MEMORY_USAGE].label, + description: ALERT_DETAILS[ALERT_MEMORY_USAGE].description, iconClass: 'bell', alertParamsExpression: (props: Props) => ( diff --git a/x-pack/plugins/monitoring/public/alerts/missing_monitoring_data_alert/missing_monitoring_data_alert.tsx b/x-pack/plugins/monitoring/public/alerts/missing_monitoring_data_alert/missing_monitoring_data_alert.tsx index 02ed9712deb1..4c8f00f8385c 100644 --- a/x-pack/plugins/monitoring/public/alerts/missing_monitoring_data_alert/missing_monitoring_data_alert.tsx +++ b/x-pack/plugins/monitoring/public/alerts/missing_monitoring_data_alert/missing_monitoring_data_alert.tsx @@ -14,6 +14,7 @@ export function createMissingMonitoringDataAlertType(): AlertTypeModel { return { id: ALERT_MISSING_MONITORING_DATA, name: ALERT_DETAILS[ALERT_MISSING_MONITORING_DATA].label, + description: ALERT_DETAILS[ALERT_MISSING_MONITORING_DATA].description, iconClass: 'bell', alertParamsExpression: (props: any) => ( ( <> diff --git a/x-pack/plugins/monitoring/server/alerts/base_alert.ts b/x-pack/plugins/monitoring/server/alerts/base_alert.ts index 48b783a45080..4c1a4d8df2ab 100644 --- a/x-pack/plugins/monitoring/server/alerts/base_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/base_alert.ts @@ -45,6 +45,7 @@ import { appendMetricbeatIndex } from '../lib/alerts/append_mb_index'; export class BaseAlert { public type!: string; public label!: string; + public description!: string; public defaultThrottle: string = '1d'; public defaultInterval: string = '1m'; public rawAlert: Alert | undefined; diff --git a/x-pack/plugins/monitoring/server/alerts/cluster_health_alert.ts b/x-pack/plugins/monitoring/server/alerts/cluster_health_alert.ts index 1d3d36413ebc..8166b1b7f607 100644 --- a/x-pack/plugins/monitoring/server/alerts/cluster_health_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/cluster_health_alert.ts @@ -40,6 +40,7 @@ const WATCH_NAME = 'elasticsearch_cluster_status'; export class ClusterHealthAlert extends BaseAlert { public type = ALERT_CLUSTER_HEALTH; public label = LEGACY_ALERT_DETAILS[ALERT_CLUSTER_HEALTH].label; + public description = LEGACY_ALERT_DETAILS[ALERT_CLUSTER_HEALTH].description; public isLegacy = true; protected actionVariables = [ diff --git a/x-pack/plugins/monitoring/server/alerts/cpu_usage_alert.ts b/x-pack/plugins/monitoring/server/alerts/cpu_usage_alert.ts index 55931e2996cb..e12660ce2003 100644 --- a/x-pack/plugins/monitoring/server/alerts/cpu_usage_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/cpu_usage_alert.ts @@ -42,6 +42,7 @@ interface CpuUsageParams { export class CpuUsageAlert extends BaseAlert { public type = ALERT_CPU_USAGE; public label = ALERT_DETAILS[ALERT_CPU_USAGE].label; + public description = ALERT_DETAILS[ALERT_CPU_USAGE].description; protected defaultParams: CpuUsageParams = { threshold: 85, diff --git a/x-pack/plugins/monitoring/server/alerts/disk_usage_alert.ts b/x-pack/plugins/monitoring/server/alerts/disk_usage_alert.ts index e54e73672435..658eb708acb9 100644 --- a/x-pack/plugins/monitoring/server/alerts/disk_usage_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/disk_usage_alert.ts @@ -34,6 +34,7 @@ import { appendMetricbeatIndex } from '../lib/alerts/append_mb_index'; export class DiskUsageAlert extends BaseAlert { public type = ALERT_DISK_USAGE; public label = ALERT_DETAILS[ALERT_DISK_USAGE].label; + public description = ALERT_DETAILS[ALERT_DISK_USAGE].description; protected defaultParams = { threshold: 80, diff --git a/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_alert.ts b/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_alert.ts index 6412dcfde54b..05498469b0c5 100644 --- a/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/elasticsearch_version_mismatch_alert.ts @@ -31,6 +31,7 @@ const WATCH_NAME = 'elasticsearch_version_mismatch'; export class ElasticsearchVersionMismatchAlert extends BaseAlert { public type = ALERT_ELASTICSEARCH_VERSION_MISMATCH; public label = LEGACY_ALERT_DETAILS[ALERT_ELASTICSEARCH_VERSION_MISMATCH].label; + public description = LEGACY_ALERT_DETAILS[ALERT_ELASTICSEARCH_VERSION_MISMATCH].description; public isLegacy = true; protected actionVariables = [ diff --git a/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_alert.ts b/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_alert.ts index 851a40163579..984ee1fb396b 100644 --- a/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/kibana_version_mismatch_alert.ts @@ -31,6 +31,7 @@ const WATCH_NAME = 'kibana_version_mismatch'; export class KibanaVersionMismatchAlert extends BaseAlert { public type = ALERT_KIBANA_VERSION_MISMATCH; public label = LEGACY_ALERT_DETAILS[ALERT_KIBANA_VERSION_MISMATCH].label; + public description = LEGACY_ALERT_DETAILS[ALERT_KIBANA_VERSION_MISMATCH].description; public isLegacy = true; protected actionVariables = [ diff --git a/x-pack/plugins/monitoring/server/alerts/license_expiration_alert.ts b/x-pack/plugins/monitoring/server/alerts/license_expiration_alert.ts index e0396ee6673e..00846e9cf759 100644 --- a/x-pack/plugins/monitoring/server/alerts/license_expiration_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/license_expiration_alert.ts @@ -36,6 +36,7 @@ const WATCH_NAME = 'xpack_license_expiration'; export class LicenseExpirationAlert extends BaseAlert { public type = ALERT_LICENSE_EXPIRATION; public label = LEGACY_ALERT_DETAILS[ALERT_LICENSE_EXPIRATION].label; + public description = LEGACY_ALERT_DETAILS[ALERT_LICENSE_EXPIRATION].description; public isLegacy = true; protected actionVariables = [ { diff --git a/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_alert.ts b/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_alert.ts index 7f5c0ea40e36..61967b2f6559 100644 --- a/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/logstash_version_mismatch_alert.ts @@ -31,6 +31,7 @@ const WATCH_NAME = 'logstash_version_mismatch'; export class LogstashVersionMismatchAlert extends BaseAlert { public type = ALERT_LOGSTASH_VERSION_MISMATCH; public label = LEGACY_ALERT_DETAILS[ALERT_LOGSTASH_VERSION_MISMATCH].label; + public description = LEGACY_ALERT_DETAILS[ALERT_LOGSTASH_VERSION_MISMATCH].description; public isLegacy = true; protected actionVariables = [ diff --git a/x-pack/plugins/monitoring/server/alerts/memory_usage_alert.ts b/x-pack/plugins/monitoring/server/alerts/memory_usage_alert.ts index c37176764c02..1564b9727c64 100644 --- a/x-pack/plugins/monitoring/server/alerts/memory_usage_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/memory_usage_alert.ts @@ -35,6 +35,7 @@ import { parseDuration } from '../../../alerts/common/parse_duration'; export class MemoryUsageAlert extends BaseAlert { public type = ALERT_MEMORY_USAGE; public label = ALERT_DETAILS[ALERT_MEMORY_USAGE].label; + public description = ALERT_DETAILS[ALERT_MEMORY_USAGE].description; protected defaultParams = { threshold: 85, diff --git a/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_alert.ts b/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_alert.ts index 456ad92855f6..4001c6b9b3ed 100644 --- a/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/missing_monitoring_data_alert.ts @@ -64,6 +64,7 @@ export class MissingMonitoringDataAlert extends BaseAlert { public type = ALERT_MISSING_MONITORING_DATA; public label = ALERT_DETAILS[ALERT_MISSING_MONITORING_DATA].label; + public description = ALERT_DETAILS[ALERT_MISSING_MONITORING_DATA].description; protected defaultParams: MissingDataParams = { duration: DEFAULT_DURATION, diff --git a/x-pack/plugins/monitoring/server/alerts/nodes_changed_alert.ts b/x-pack/plugins/monitoring/server/alerts/nodes_changed_alert.ts index 7b54ef629cba..e86998d27238 100644 --- a/x-pack/plugins/monitoring/server/alerts/nodes_changed_alert.ts +++ b/x-pack/plugins/monitoring/server/alerts/nodes_changed_alert.ts @@ -28,6 +28,7 @@ const WATCH_NAME = 'elasticsearch_nodes'; export class NodesChangedAlert extends BaseAlert { public type = ALERT_NODES_CHANGED; public label = LEGACY_ALERT_DETAILS[ALERT_NODES_CHANGED].label; + public description = LEGACY_ALERT_DETAILS[ALERT_NODES_CHANGED].description; public isLegacy = true; protected actionVariables = [ diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/geo_threshold/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/geo_threshold/index.ts index 2a421a4825e6..9f33e2c2495c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/geo_threshold/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/geo_threshold/index.ts @@ -16,6 +16,9 @@ export function getAlertType(): AlertTypeModel import('./query_builder')), validate: validateExpression, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/index.ts b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/index.ts index d7ce73ce0c7d..61141e6e2860 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/index.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/index.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { lazy } from 'react'; +import { i18n } from '@kbn/i18n'; import { AlertTypeModel } from '../../../../types'; import { validateExpression } from './validation'; @@ -13,7 +14,12 @@ import { AlertsContextValue } from '../../../context/alerts_context'; export function getAlertType(): AlertTypeModel { return { id: '.index-threshold', - name: 'Index threshold', + name: i18n.translate('xpack.triggersActionsUI.indexThresholdAlert.nameText', { + defaultMessage: 'Index threshold', + }), + description: i18n.translate('xpack.triggersActionsUI.indexThresholdAlert.descriptionText', { + defaultMessage: 'Alert when an aggregated query meets the threshold.', + }), iconClass: 'alert', alertParamsExpression: lazy(() => import('./expression')), validate: validateExpression, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx index 0ac20626e104..2a69580d7185 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_add.test.tsx @@ -98,6 +98,7 @@ describe('alert_add', () => { id: 'my-alert-type', iconClass: 'test', name: 'test-alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx index fe86e5da9876..34f9f29274f8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_edit.test.tsx @@ -51,6 +51,7 @@ describe('alert_edit', () => { id: 'my-alert-type', iconClass: 'test', name: 'test-alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx index cda791489d7f..98eaea64797b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alert_form/alert_form.test.tsx @@ -31,6 +31,7 @@ describe('alert_form', () => { id: 'my-alert-type', iconClass: 'test', name: 'test-alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, @@ -57,6 +58,7 @@ describe('alert_form', () => { id: 'non-edit-alert-type', iconClass: 'test', name: 'non edit alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, @@ -241,6 +243,7 @@ describe('alert_form', () => { id: 'same-consumer-producer-alert-type', iconClass: 'test', name: 'test-alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, @@ -251,6 +254,7 @@ describe('alert_form', () => { id: 'other-consumer-producer-alert-type', iconClass: 'test', name: 'test-alert', + description: 'test', validate: (): ValidationResult => { return { errors: {} }; }, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx index 21dd17b538c6..1de92d61f09c 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_list/components/alerts_list.test.tsx @@ -42,6 +42,7 @@ const alertTypeRegistry = alertTypeRegistryMock.create(); const alertType = { id: 'test_alert_type', name: 'some alert type', + description: 'test', iconClass: 'test', validate: (): ValidationResult => { return { errors: {} }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/type_registry.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/type_registry.test.ts index 10195e925611..311f366df74e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/type_registry.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/type_registry.test.ts @@ -15,6 +15,7 @@ const getTestAlertType = (id?: string, name?: string, iconClass?: string) => { return { id: id || 'test-alet-type', name: name || 'Test alert type', + description: 'Test description', iconClass: iconClass || 'icon', validate: (): ValidationResult => { return { errors: {} }; diff --git a/x-pack/plugins/triggers_actions_ui/public/types.ts b/x-pack/plugins/triggers_actions_ui/public/types.ts index 65a8dd0be852..bf1ff26af42e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/types.ts +++ b/x-pack/plugins/triggers_actions_ui/public/types.ts @@ -174,6 +174,7 @@ export interface AlertTypeParamsExpressionProps< export interface AlertTypeModel { id: string; name: string | JSX.Element; + description: string; iconClass: string; validate: (alertParams: AlertParamsType) => ValidationResult; alertParamsExpression: diff --git a/x-pack/plugins/uptime/common/translations.ts b/x-pack/plugins/uptime/common/translations.ts index a4a20a1445f5..b85688fda859 100644 --- a/x-pack/plugins/uptime/common/translations.ts +++ b/x-pack/plugins/uptime/common/translations.ts @@ -32,4 +32,7 @@ export const MonitorStatusTranslations = { name: i18n.translate('xpack.uptime.alerts.monitorStatus.clientName', { defaultMessage: 'Uptime monitor status', }), + description: i18n.translate('xpack.uptime.alerts.monitorStatus.description', { + defaultMessage: 'Alert when a monitor is down or an availability threshold is breached.', + }), }; diff --git a/x-pack/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts b/x-pack/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts index 0ee78f5e4d81..5106fcbc97bc 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts +++ b/x-pack/plugins/uptime/public/lib/alert_types/__tests__/monitor_status.test.ts @@ -203,6 +203,7 @@ describe('monitor status alert type', () => { Object { "alertParamsExpression": [Function], "defaultActionMessage": "Monitor {{state.monitorName}} with url {{{state.monitorUrl}}} is {{state.statusMessage}} from {{state.observerLocation}}. The latest error message is {{{state.latestErrorMessage}}}", + "description": "Alert when a monitor is down or an availability threshold is breached.", "iconClass": "uptimeApp", "id": "xpack.uptime.alerts.monitorStatus", "name": import('./lazy_wrapper/duration_anomaly')); export const initDurationAnomalyAlertType: AlertTypeInitializer = ({ @@ -23,6 +23,7 @@ export const initDurationAnomalyAlertType: AlertTypeInitializer = ({ ), name, + description, validate: () => ({ errors: {} }), defaultActionMessage, requiresAppContext: true, diff --git a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx index 935fded19b9e..4e3d9a3c6e0a 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx @@ -12,7 +12,7 @@ import { AlertTypeInitializer } from '.'; import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; import { MonitorStatusTranslations } from '../../../common/translations'; -const { defaultActionMessage } = MonitorStatusTranslations; +const { defaultActionMessage, description } = MonitorStatusTranslations; const MonitorStatusAlert = React.lazy(() => import('./lazy_wrapper/monitor_status')); @@ -29,6 +29,7 @@ export const initMonitorStatusAlertType: AlertTypeInitializer = ({ defaultMessage="Uptime monitor status" /> ), + description, iconClass: 'uptimeApp', alertParamsExpression: (params: any) => ( diff --git a/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx b/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx index 9019fc216192..41ff08b0da97 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/tls.tsx @@ -10,7 +10,7 @@ import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts'; import { TlsTranslations } from './translations'; import { AlertTypeInitializer } from '.'; -const { name, defaultActionMessage } = TlsTranslations; +const { name, defaultActionMessage, description } = TlsTranslations; const TLSAlert = React.lazy(() => import('./lazy_wrapper/tls_alert')); export const initTlsAlertType: AlertTypeInitializer = ({ core, plugins }): AlertTypeModel => ({ id: CLIENT_ALERT_TYPES.TLS, @@ -19,6 +19,7 @@ export const initTlsAlertType: AlertTypeInitializer = ({ core, plugins }): Alert ), name, + description, validate: () => ({ errors: {} }), defaultActionMessage, requiresAppContext: false, diff --git a/x-pack/plugins/uptime/public/lib/alert_types/translations.ts b/x-pack/plugins/uptime/public/lib/alert_types/translations.ts index 99edfb3b5303..590af758d87c 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/translations.ts +++ b/x-pack/plugins/uptime/public/lib/alert_types/translations.ts @@ -35,6 +35,9 @@ Aging Certificates: {agingCommonNameAndDate} name: i18n.translate('xpack.uptime.alerts.tls.clientName', { defaultMessage: 'Uptime TLS', }), + description: i18n.translate('xpack.uptime.alerts.tls.description', { + defaultMessage: 'Alert when the TLS certificate of an Uptime monitor is about to expire.', + }), }; export const DurationAnomalyTranslations = { @@ -55,4 +58,7 @@ Response times as high as {slowestAnomalyResponse} have been detected from locat name: i18n.translate('xpack.uptime.alerts.durationAnomaly.clientName', { defaultMessage: 'Uptime Duration Anomaly', }), + description: i18n.translate('xpack.uptime.alerts.durationAnomaly.description', { + defaultMessage: 'Alert when the Uptime monitor duration is anaomalous.', + }), }; diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts index e149fad5e906..c738ce0697f7 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/public/plugin.ts @@ -29,6 +29,7 @@ export class AlertingFixturePlugin implements Plugin React.createElement('div', null, 'Test Always Firing'), validate: () => { @@ -40,6 +41,7 @@ export class AlertingFixturePlugin implements Plugin React.createElement('div', null, 'Test Noop'), validate: () => {