mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Add descriptions to alert types (#81850)
* 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 <casper@formgeist.com> * Update x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts Co-authored-by: Casper Hübertz <casper@formgeist.com> * 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 <casper@formgeist.com>
This commit is contained in:
parent
ca53f774ba
commit
eb43158bdd
39 changed files with 132 additions and 4 deletions
|
@ -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']) => {
|
||||
|
|
|
@ -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']) => {
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.',
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -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) => (
|
||||
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_CPU_USAGE].paramDetails} />
|
||||
|
|
|
@ -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) => (
|
||||
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_DISK_USAGE].paramDetails} />
|
||||
|
|
|
@ -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: () => (
|
||||
<Fragment>
|
||||
|
|
|
@ -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) => (
|
||||
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_MEMORY_USAGE].paramDetails} />
|
||||
|
|
|
@ -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) => (
|
||||
<Expression
|
||||
|
|
|
@ -18,6 +18,7 @@ interface ThreadPoolTypes {
|
|||
|
||||
interface ThreadPoolRejectionAlertDetails {
|
||||
label: string;
|
||||
description: string;
|
||||
paramDetails: CommonAlertParamDetails;
|
||||
}
|
||||
|
||||
|
@ -28,6 +29,7 @@ export function createThreadPoolRejectionsAlertType(
|
|||
return {
|
||||
id: alertType,
|
||||
name: threadPoolAlertDetails.label,
|
||||
description: threadPoolAlertDetails.description,
|
||||
iconClass: 'bell',
|
||||
alertParamsExpression: (props: Props) => (
|
||||
<>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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 = [
|
||||
{
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -16,6 +16,9 @@ export function getAlertType(): AlertTypeModel<GeoThresholdAlertParams, AlertsCo
|
|||
name: i18n.translate('xpack.triggersActionsUI.geoThreshold.name.trackingThreshold', {
|
||||
defaultMessage: 'Tracking threshold',
|
||||
}),
|
||||
description: i18n.translate('xpack.triggersActionsUI.geoThreshold.descriptionText', {
|
||||
defaultMessage: 'Alert when an entity enters or leaves a geo boundary.',
|
||||
}),
|
||||
iconClass: 'globe',
|
||||
alertParamsExpression: lazy(() => import('./query_builder')),
|
||||
validate: validateExpression,
|
||||
|
|
|
@ -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<IndexThresholdAlertParams, AlertsContextValue> {
|
||||
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,
|
||||
|
|
|
@ -98,6 +98,7 @@ describe('alert_add', () => {
|
|||
id: 'my-alert-type',
|
||||
iconClass: 'test',
|
||||
name: 'test-alert',
|
||||
description: 'test',
|
||||
validate: (): ValidationResult => {
|
||||
return { errors: {} };
|
||||
},
|
||||
|
|
|
@ -51,6 +51,7 @@ describe('alert_edit', () => {
|
|||
id: 'my-alert-type',
|
||||
iconClass: 'test',
|
||||
name: 'test-alert',
|
||||
description: 'test',
|
||||
validate: (): ValidationResult => {
|
||||
return { errors: {} };
|
||||
},
|
||||
|
|
|
@ -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: {} };
|
||||
},
|
||||
|
|
|
@ -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: {} };
|
||||
|
|
|
@ -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: {} };
|
||||
|
|
|
@ -174,6 +174,7 @@ export interface AlertTypeParamsExpressionProps<
|
|||
export interface AlertTypeModel<AlertParamsType = any, AlertsContextValue = any> {
|
||||
id: string;
|
||||
name: string | JSX.Element;
|
||||
description: string;
|
||||
iconClass: string;
|
||||
validate: (alertParams: AlertParamsType) => ValidationResult;
|
||||
alertParamsExpression:
|
||||
|
|
|
@ -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.',
|
||||
}),
|
||||
};
|
||||
|
|
|
@ -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": <FormattedMessage
|
||||
|
|
|
@ -10,7 +10,7 @@ import { CLIENT_ALERT_TYPES } from '../../../common/constants/alerts';
|
|||
import { DurationAnomalyTranslations } from './translations';
|
||||
import { AlertTypeInitializer } from '.';
|
||||
|
||||
const { name, defaultActionMessage } = DurationAnomalyTranslations;
|
||||
const { name, defaultActionMessage, description } = DurationAnomalyTranslations;
|
||||
const DurationAnomalyAlert = React.lazy(() => import('./lazy_wrapper/duration_anomaly'));
|
||||
|
||||
export const initDurationAnomalyAlertType: AlertTypeInitializer = ({
|
||||
|
@ -23,6 +23,7 @@ export const initDurationAnomalyAlertType: AlertTypeInitializer = ({
|
|||
<DurationAnomalyAlert core={core} plugins={plugins} params={params} />
|
||||
),
|
||||
name,
|
||||
description,
|
||||
validate: () => ({ errors: {} }),
|
||||
defaultActionMessage,
|
||||
requiresAppContext: true,
|
||||
|
|
|
@ -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) => (
|
||||
<MonitorStatusAlert core={core} plugins={plugins} params={params} />
|
||||
|
|
|
@ -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
|
|||
<TLSAlert core={core} plugins={plugins} params={params} />
|
||||
),
|
||||
name,
|
||||
description,
|
||||
validate: () => ({ errors: {} }),
|
||||
defaultActionMessage,
|
||||
requiresAppContext: false,
|
||||
|
|
|
@ -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.',
|
||||
}),
|
||||
};
|
||||
|
|
|
@ -29,6 +29,7 @@ export class AlertingFixturePlugin implements Plugin<Setup, Start, AlertingExamp
|
|||
triggersActionsUi.alertTypeRegistry.register({
|
||||
id: 'test.always-firing',
|
||||
name: 'Test Always Firing',
|
||||
description: 'Always fires',
|
||||
iconClass: 'alert',
|
||||
alertParamsExpression: () => React.createElement('div', null, 'Test Always Firing'),
|
||||
validate: () => {
|
||||
|
@ -40,6 +41,7 @@ export class AlertingFixturePlugin implements Plugin<Setup, Start, AlertingExamp
|
|||
triggersActionsUi.alertTypeRegistry.register({
|
||||
id: 'test.noop',
|
||||
name: 'Test Noop',
|
||||
description: `Doesn't do anything`,
|
||||
iconClass: 'alert',
|
||||
alertParamsExpression: () => React.createElement('div', null, 'Test Noop'),
|
||||
validate: () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue