Skip to content

Commit c94f623

Browse files
authored
Add description and documentation link in alert flyout (#81526) (#82795)
* Add description and documentation URL in alert flyout * Add unit tests * Fix type check * Add horizontal rule * Design fixes * Fix uptime alert link * Fix uptime urls * Add anchor tag * Fix jest test failures * Fix monitoring links
1 parent a7832ff commit c94f623

File tree

27 files changed

+127
-2
lines changed

27 files changed

+127
-2
lines changed

x-pack/examples/alerting_example/public/alert_types/always_firing.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function getAlertType(): AlertTypeModel {
2222
name: 'Always Fires',
2323
description: 'Alert when called',
2424
iconClass: 'bolt',
25+
documentationUrl: null,
2526
alertParamsExpression: AlwaysFiringExpression,
2627
validate: (alertParams: AlwaysFiringParamsProps['alertParams']) => {
2728
const { instances } = alertParams;

x-pack/examples/alerting_example/public/alert_types/astros.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function getAlertType(): AlertTypeModel {
4747
name: 'People Are In Space Right Now',
4848
description: 'Alert when people are in space right now',
4949
iconClass: 'globe',
50+
documentationUrl: null,
5051
alertParamsExpression: PeopleinSpaceExpression,
5152
validate: (alertParams: PeopleinSpaceParamsProps['alertParams']) => {
5253
const { outerSpaceCapacity, craft, op } = alertParams;

x-pack/plugins/apm/public/components/alerting/register_apm_alerts.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export function registerApmAlerts(
2222
'Alert when the number of errors in a service exceeds a defined threshold.',
2323
}),
2424
iconClass: 'bell',
25+
documentationUrl(docLinks) {
26+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/apm-alerts.html`;
27+
},
2528
alertParamsExpression: lazy(() => import('./ErrorCountAlertTrigger')),
2629
validate: () => ({
2730
errors: [],
@@ -53,6 +56,9 @@ export function registerApmAlerts(
5356
}
5457
),
5558
iconClass: 'bell',
59+
documentationUrl(docLinks) {
60+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/apm-alerts.html`;
61+
},
5662
alertParamsExpression: lazy(
5763
() => import('./TransactionDurationAlertTrigger')
5864
),
@@ -87,6 +93,9 @@ export function registerApmAlerts(
8793
}
8894
),
8995
iconClass: 'bell',
96+
documentationUrl(docLinks) {
97+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/apm-alerts.html`;
98+
},
9099
alertParamsExpression: lazy(
91100
() => import('./TransactionErrorRateAlertTrigger')
92101
),
@@ -121,6 +130,9 @@ export function registerApmAlerts(
121130
}
122131
),
123132
iconClass: 'bell',
133+
documentationUrl(docLinks) {
134+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/apm-alerts.html`;
135+
},
124136
alertParamsExpression: lazy(
125137
() => import('./TransactionDurationAnomalyAlertTrigger')
126138
),

x-pack/plugins/infra/public/alerting/inventory/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export function createInventoryMetricAlertType(): AlertTypeModel {
2121
defaultMessage: 'Alert when the inventory exceeds a defined threshold.',
2222
}),
2323
iconClass: 'bell',
24+
documentationUrl(docLinks) {
25+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/infrastructure-threshold-alert.html`;
26+
},
2427
alertParamsExpression: React.lazy(() => import('./components/expression')),
2528
validate: validateMetricThreshold,
2629
defaultActionMessage: i18n.translate(

x-pack/plugins/infra/public/alerting/log_threshold/log_threshold_alert_type.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export function getAlertType(): AlertTypeModel {
1919
defaultMessage: 'Alert when the log aggregation exceeds the threshold.',
2020
}),
2121
iconClass: 'bell',
22+
documentationUrl(docLinks) {
23+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/logs-threshold-alert.html`;
24+
},
2225
alertParamsExpression: React.lazy(() => import('./components/expression_editor/editor')),
2326
validate: validateExpression,
2427
defaultActionMessage: i18n.translate(

x-pack/plugins/infra/public/alerting/metric_threshold/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export function createMetricThresholdAlertType(): AlertTypeModel {
2121
defaultMessage: 'Alert when the metrics aggregation exceeds the threshold.',
2222
}),
2323
iconClass: 'bell',
24+
documentationUrl(docLinks) {
25+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/observability/${docLinks.DOC_LINK_VERSION}/metrics-threshold-alert.html`;
26+
},
2427
alertParamsExpression: React.lazy(() => import('./components/expression')),
2528
validate: validateMetricThreshold,
2629
defaultActionMessage: i18n.translate(

x-pack/plugins/monitoring/public/alerts/cpu_usage_alert/cpu_usage_alert.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export function createCpuUsageAlertType(): AlertTypeModel {
1616
name: ALERT_DETAILS[ALERT_CPU_USAGE].label,
1717
description: ALERT_DETAILS[ALERT_CPU_USAGE].description,
1818
iconClass: 'bell',
19+
documentationUrl(docLinks) {
20+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-cpu-threshold`;
21+
},
1922
alertParamsExpression: (props: Props) => (
2023
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_CPU_USAGE].paramDetails} />
2124
),

x-pack/plugins/monitoring/public/alerts/disk_usage_alert/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export function createDiskUsageAlertType(): AlertTypeModel {
1818
name: ALERT_DETAILS[ALERT_DISK_USAGE].label,
1919
description: ALERT_DETAILS[ALERT_DISK_USAGE].description,
2020
iconClass: 'bell',
21+
documentationUrl(docLinks) {
22+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-disk-usage-threshold`;
23+
},
2124
alertParamsExpression: (props: Props) => (
2225
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_DISK_USAGE].paramDetails} />
2326
),

x-pack/plugins/monitoring/public/alerts/legacy_alert/legacy_alert.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export function createLegacyAlertTypes(): AlertTypeModel[] {
1818
name: LEGACY_ALERT_DETAILS[legacyAlert].label,
1919
description: LEGACY_ALERT_DETAILS[legacyAlert].description,
2020
iconClass: 'bell',
21+
documentationUrl(docLinks) {
22+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/cluster-alerts.html`;
23+
},
2124
alertParamsExpression: () => (
2225
<Fragment>
2326
<EuiSpacer />

x-pack/plugins/monitoring/public/alerts/memory_usage_alert/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export function createMemoryUsageAlertType(): AlertTypeModel {
1818
name: ALERT_DETAILS[ALERT_MEMORY_USAGE].label,
1919
description: ALERT_DETAILS[ALERT_MEMORY_USAGE].description,
2020
iconClass: 'bell',
21+
documentationUrl(docLinks) {
22+
return `${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/kibana-alerts.html#kibana-alerts-jvm-memory-threshold`;
23+
},
2124
alertParamsExpression: (props: Props) => (
2225
<Expression {...props} paramDetails={ALERT_DETAILS[ALERT_MEMORY_USAGE].paramDetails} />
2326
),

0 commit comments

Comments
 (0)