From 6ba4d7440d34bbea11699fbe218a0020ff88a4f4 Mon Sep 17 00:00:00 2001 From: Dominique Clarke Date: Tue, 27 Aug 2024 08:50:48 -0400 Subject: [PATCH] [Rules and Alerting][Stack Monitoring] Quote cluster uuid in global state link sent via alerting rules (#190341) ## Summary Closes https://github.com/elastic/kibana/issues/191250 This PR fixes the URL contained in the Shard size alerting rule when the email body contains the `{{ context.internalFullMessage}}` action variable. The generated URL which triggers a `rison decoder error` `https:///app/monitoring#/elasticsearch/indices/?_g=(cluster_uuid:foobar))` is fixed by adding a pair of single quotes around the cluster UUID `https:///app/monitoring#/elasticsearch/indices/?_g=(cluster_uuid:'foobar'))` Worth noting that this issue doesn't only impact the Shard size rule, but many other rule types, namely: * CPU usage * Disk usage * Memory usage * CCR read exception * ES version mismatch * Kibana version mismatch * Logstash version mismatch * Missing monitoring data * Thread pool search rejections * Thread pool write rejections --------- Co-authored-by: Valentin Crettaz Co-authored-by: Valentin Crettaz --- x-pack/plugins/monitoring/server/rules/base_rule.ts | 2 +- .../server/rules/ccr_read_exceptions_rule.test.ts | 8 ++++---- .../monitoring/server/rules/cpu_usage_rule.test.ts | 8 ++++---- .../monitoring/server/rules/disk_usage_rule.test.ts | 8 ++++---- .../rules/elasticsearch_version_mismatch_rule.test.ts | 4 ++-- .../server/rules/kibana_version_mismatch_rule.test.ts | 4 ++-- .../monitoring/server/rules/large_shard_size_rule.test.ts | 8 ++++---- .../server/rules/logstash_version_mismatch_rule.test.ts | 4 ++-- .../monitoring/server/rules/memory_usage_rule.test.ts | 8 ++++---- .../server/rules/missing_monitoring_data_rule.test.ts | 8 ++++---- .../rules/thread_pool_search_rejections_rule.test.ts | 8 ++++---- .../rules/thread_pool_write_rejections_rule.test.ts | 8 ++++---- 12 files changed, 39 insertions(+), 39 deletions(-) diff --git a/x-pack/plugins/monitoring/server/rules/base_rule.ts b/x-pack/plugins/monitoring/server/rules/base_rule.ts index f04ca15be27dd..cb8bfcf400d45 100644 --- a/x-pack/plugins/monitoring/server/rules/base_rule.ts +++ b/x-pack/plugins/monitoring/server/rules/base_rule.ts @@ -405,7 +405,7 @@ export class BaseRule { } protected createGlobalStateLink(link: string, clusterUuid: string, ccs?: string) { - const globalState = [`cluster_uuid:${clusterUuid}`]; + const globalState = [`cluster_uuid:'${clusterUuid}'`]; if (ccs) { globalState.push(`ccs:${ccs}`); } diff --git a/x-pack/plugins/monitoring/server/rules/ccr_read_exceptions_rule.test.ts b/x-pack/plugins/monitoring/server/rules/ccr_read_exceptions_rule.test.ts index 806c382cb3707..34f9c24b6d49b 100644 --- a/x-pack/plugins/monitoring/server/rules/ccr_read_exceptions_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/ccr_read_exceptions_rule.test.ts @@ -279,9 +279,9 @@ describe('CCRReadExceptionsRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'BcK-0pmsQniyPQfZuauuXw_remote_cluster_1:.follower_index_1', context: { - internalFullMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Current 'follower_index' index affected: ${followerIndex}. [View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Current 'follower_index' index affected: ${followerIndex}. [View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Verify follower and leader index relationships on the affected remote cluster.`, - action: `[View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify follower and leader index relationships on the affected remote cluster.', clusterName, @@ -452,9 +452,9 @@ describe('CCRReadExceptionsRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'BcK-0pmsQniyPQfZuauuXw_remote_cluster_1:.follower_index_1', context: { - internalFullMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Current 'follower_index' index affected: ${followerIndex}. [View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + internalFullMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Current 'follower_index' index affected: ${followerIndex}. [View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, internalShortMessage: `CCR read exceptions alert is firing for the following remote cluster: ${remoteCluster}. Verify follower and leader index relationships on the affected remote cluster.`, - action: `[View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + action: `[View CCR stats](http://localhost:5601/app/monitoring#/elasticsearch/ccr?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: 'Verify follower and leader index relationships on the affected remote cluster.', clusterName, diff --git a/x-pack/plugins/monitoring/server/rules/cpu_usage_rule.test.ts b/x-pack/plugins/monitoring/server/rules/cpu_usage_rule.test.ts index 1b107d4031981..0558c2cdf6d33 100644 --- a/x-pack/plugins/monitoring/server/rules/cpu_usage_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/cpu_usage_rule.test.ts @@ -185,9 +185,9 @@ describe('CpuUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify CPU level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify CPU level of node.', clusterName, count, @@ -315,9 +315,9 @@ describe('CpuUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `CPU usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify CPU level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: 'Verify CPU level of node.', clusterName, count, diff --git a/x-pack/plugins/monitoring/server/rules/disk_usage_rule.test.ts b/x-pack/plugins/monitoring/server/rules/disk_usage_rule.test.ts index 5e1c30dce78f6..6e7f66b219e26 100644 --- a/x-pack/plugins/monitoring/server/rules/disk_usage_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/disk_usage_rule.test.ts @@ -232,9 +232,9 @@ describe('DiskUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify disk usage level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify disk usage level of node.', clusterName, count, @@ -381,9 +381,9 @@ describe('DiskUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `Disk usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify disk usage level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/myNodeId?_g=(cluster_uuid:abc123,ccs:testCluster))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/myNodeId?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: 'Verify disk usage level of node.', clusterName, count, diff --git a/x-pack/plugins/monitoring/server/rules/elasticsearch_version_mismatch_rule.test.ts b/x-pack/plugins/monitoring/server/rules/elasticsearch_version_mismatch_rule.test.ts index eafb51136fc73..4269c0d6b5a5e 100644 --- a/x-pack/plugins/monitoring/server/rules/elasticsearch_version_mismatch_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/elasticsearch_version_mismatch_rule.test.ts @@ -140,9 +140,9 @@ describe('ElasticsearchVersionMismatchAlert', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'abc123', context: { - action: `[View nodes](UNIT_TEST_URL/app/monitoring#/elasticsearch/nodes?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View nodes](UNIT_TEST_URL/app/monitoring#/elasticsearch/nodes?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify you have the same version across all nodes.', - internalFullMessage: `Elasticsearch version mismatch alert is firing for testCluster. Elasticsearch is running 8.0.0, 7.2.1. [View nodes](UNIT_TEST_URL/app/monitoring#/elasticsearch/nodes?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Elasticsearch version mismatch alert is firing for testCluster. Elasticsearch is running 8.0.0, 7.2.1. [View nodes](UNIT_TEST_URL/app/monitoring#/elasticsearch/nodes?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: 'Elasticsearch version mismatch alert is firing for testCluster. Verify you have the same version across all nodes.', versionList: ['8.0.0', '7.2.1'], diff --git a/x-pack/plugins/monitoring/server/rules/kibana_version_mismatch_rule.test.ts b/x-pack/plugins/monitoring/server/rules/kibana_version_mismatch_rule.test.ts index 46b777dbee4a2..7a3370c4092a6 100644 --- a/x-pack/plugins/monitoring/server/rules/kibana_version_mismatch_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/kibana_version_mismatch_rule.test.ts @@ -143,9 +143,9 @@ describe('KibanaVersionMismatchRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'abc123', context: { - action: `[View instances](UNIT_TEST_URL/app/monitoring#/kibana/instances?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View instances](UNIT_TEST_URL/app/monitoring#/kibana/instances?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify you have the same version across all instances.', - internalFullMessage: `Kibana version mismatch alert is firing for testCluster. Kibana is running 8.0.0, 7.2.1. [View instances](UNIT_TEST_URL/app/monitoring#/kibana/instances?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Kibana version mismatch alert is firing for testCluster. Kibana is running 8.0.0, 7.2.1. [View instances](UNIT_TEST_URL/app/monitoring#/kibana/instances?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: 'Kibana version mismatch alert is firing for testCluster. Verify you have the same version across all instances.', versionList: ['8.0.0', '7.2.1'], diff --git a/x-pack/plugins/monitoring/server/rules/large_shard_size_rule.test.ts b/x-pack/plugins/monitoring/server/rules/large_shard_size_rule.test.ts index 0ad6c7687c203..00272030ec4ab 100644 --- a/x-pack/plugins/monitoring/server/rules/large_shard_size_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/large_shard_size_rule.test.ts @@ -206,9 +206,9 @@ describe('LargeShardSizeRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'abc123:apm-8.0.0-onboarding-2021.06.30', context: { - internalFullMessage: `Large shard size alert is firing for the following index: ${shardIndex}. [View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Large shard size alert is firing for the following index: ${shardIndex}. [View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `Large shard size alert is firing for the following index: ${shardIndex}. Investigate indices with large shard sizes.`, - action: `[View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Investigate indices with large shard sizes.', clusterName, state: 'firing', @@ -327,9 +327,9 @@ describe('LargeShardSizeRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'abc123:apm-8.0.0-onboarding-2021.06.30', context: { - internalFullMessage: `Large shard size alert is firing for the following index: ${shardIndex}. [View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + internalFullMessage: `Large shard size alert is firing for the following index: ${shardIndex}. [View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, internalShortMessage: `Large shard size alert is firing for the following index: ${shardIndex}. Investigate indices with large shard sizes.`, - action: `[View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + action: `[View index shard size stats](http://localhost:5601/app/monitoring#/elasticsearch/indices/${shardIndex}?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: 'Investigate indices with large shard sizes.', clusterName, state: 'firing', diff --git a/x-pack/plugins/monitoring/server/rules/logstash_version_mismatch_rule.test.ts b/x-pack/plugins/monitoring/server/rules/logstash_version_mismatch_rule.test.ts index 97cbbd2c619a6..7944bd129f2f1 100644 --- a/x-pack/plugins/monitoring/server/rules/logstash_version_mismatch_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/logstash_version_mismatch_rule.test.ts @@ -141,9 +141,9 @@ describe('LogstashVersionMismatchRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'abc123', context: { - action: `[View nodes](UNIT_TEST_URL/app/monitoring#/logstash/nodes?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View nodes](UNIT_TEST_URL/app/monitoring#/logstash/nodes?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify you have the same version across all nodes.', - internalFullMessage: `Logstash version mismatch alert is firing for testCluster. Logstash is running 8.0.0, 7.2.1. [View nodes](UNIT_TEST_URL/app/monitoring#/logstash/nodes?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Logstash version mismatch alert is firing for testCluster. Logstash is running 8.0.0, 7.2.1. [View nodes](UNIT_TEST_URL/app/monitoring#/logstash/nodes?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: 'Logstash version mismatch alert is firing for testCluster. Verify you have the same version across all nodes.', versionList: ['8.0.0', '7.2.1'], diff --git a/x-pack/plugins/monitoring/server/rules/memory_usage_rule.test.ts b/x-pack/plugins/monitoring/server/rules/memory_usage_rule.test.ts index c1a8836e293c1..6da0fb751c038 100644 --- a/x-pack/plugins/monitoring/server/rules/memory_usage_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/memory_usage_rule.test.ts @@ -216,9 +216,9 @@ describe('MemoryUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify memory usage level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify memory usage level of node.', clusterName, count, @@ -380,9 +380,9 @@ describe('MemoryUsageRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'myNodeId', context: { - internalFullMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `Memory usage alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify memory usage level of node.`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:testCluster))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: 'Verify memory usage level of node.', clusterName, count, diff --git a/x-pack/plugins/monitoring/server/rules/missing_monitoring_data_rule.test.ts b/x-pack/plugins/monitoring/server/rules/missing_monitoring_data_rule.test.ts index 8bf66a839d6dd..4dd7515e7e33e 100644 --- a/x-pack/plugins/monitoring/server/rules/missing_monitoring_data_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/missing_monitoring_data_rule.test.ts @@ -171,11 +171,11 @@ describe('MissingMonitoringDataRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. [View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. [View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. Verify the node is up and running, then double check the monitoring settings.`, nodes: `node: ${nodeName}`, node: `node: ${nodeName}`, - action: `[View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: 'Verify the node is up and running, then double check the monitoring settings.', clusterName, @@ -287,11 +287,11 @@ describe('MissingMonitoringDataRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. [View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. [View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `We have not detected any monitoring data for node ${nodeName} in cluster: ${clusterName}. Verify the node is up and running, then double check the monitoring settings.`, nodes: `node: ${nodeName}`, node: `node: ${nodeName}`, - action: `[View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + action: `[View what monitoring data we do have for this node.](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, actionPlain: 'Verify the node is up and running, then double check the monitoring settings.', clusterName, diff --git a/x-pack/plugins/monitoring/server/rules/thread_pool_search_rejections_rule.test.ts b/x-pack/plugins/monitoring/server/rules/thread_pool_search_rejections_rule.test.ts index c6602f536a83c..7f93f3cfe6f94 100644 --- a/x-pack/plugins/monitoring/server/rules/thread_pool_search_rejections_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/thread_pool_search_rejections_rule.test.ts @@ -223,10 +223,10 @@ describe('ThreadpoolSearchRejectionsRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify thread pool ${threadPoolType} rejections for the affected node.`, node: `${nodeName}`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: `Verify thread pool ${threadPoolType} rejections for the affected node.`, clusterName, count: 1, @@ -387,10 +387,10 @@ describe('ThreadpoolSearchRejectionsRule', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `Thread pool search rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify thread pool ${threadPoolType} rejections for the affected node.`, node: `${nodeName}`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/esNode1?_g=(cluster_uuid:abc123,ccs:testCluster))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/esNode1?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: `Verify thread pool ${threadPoolType} rejections for the affected node.`, clusterName, count, diff --git a/x-pack/plugins/monitoring/server/rules/thread_pool_write_rejections_rule.test.ts b/x-pack/plugins/monitoring/server/rules/thread_pool_write_rejections_rule.test.ts index 163dc2b1a677b..71565b9e75c38 100644 --- a/x-pack/plugins/monitoring/server/rules/thread_pool_write_rejections_rule.test.ts +++ b/x-pack/plugins/monitoring/server/rules/thread_pool_write_rejections_rule.test.ts @@ -223,10 +223,10 @@ describe('ThreadpoolWriteRejectionsAlert', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + internalFullMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, internalShortMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify thread pool ${threadPoolType} rejections for the affected node.`, node: `${nodeName}`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid}))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}'))`, actionPlain: `Verify thread pool ${threadPoolType} rejections for the affected node.`, clusterName, count: 1, @@ -387,10 +387,10 @@ describe('ThreadpoolWriteRejectionsAlert', () => { expect(services.alertsClient.setAlertData).toHaveBeenCalledWith({ id: 'esNode1', context: { - internalFullMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:${clusterUuid},ccs:${ccs}))`, + internalFullMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. [View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/${nodeId}?_g=(cluster_uuid:'${clusterUuid}',ccs:${ccs}))`, internalShortMessage: `Thread pool ${threadPoolType} rejections alert is firing for node ${nodeName} in cluster: ${clusterName}. Verify thread pool ${threadPoolType} rejections for the affected node.`, node: `${nodeName}`, - action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/esNode1?_g=(cluster_uuid:abc123,ccs:testCluster))`, + action: `[View node](http://localhost:5601/app/monitoring#/elasticsearch/nodes/esNode1?_g=(cluster_uuid:'${clusterUuid}',ccs:testCluster))`, actionPlain: `Verify thread pool ${threadPoolType} rejections for the affected node.`, clusterName, count,