From 8b4a4fa455b0997442fa2790c9a633d4164c07cc Mon Sep 17 00:00:00 2001 From: Gabriel Cocenza Date: Thu, 19 Dec 2024 10:03:42 -0300 Subject: [PATCH] - add unit test - fix msg --- .../test_alert_rules/test_opensearch_rules.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_alert_rules/test_opensearch_rules.yaml b/tests/unit/test_alert_rules/test_opensearch_rules.yaml index 7a6b8f719..3f635d934 100644 --- a/tests/unit/test_alert_rules/test_opensearch_rules.yaml +++ b/tests/unit/test_alert_rules/test_opensearch_rules.yaml @@ -191,5 +191,20 @@ tests: severity: warning cluster: opensearch-x7zb exp_annotations: - message: "Cluster opensearch-x7zb is throttling. Please optimize queries and indexing patterns or consider scale the application." + message: "Cluster opensearch-x7zb is throttling. Please review your indexing request rate, index lifecycle or consider scale the application." summary: "OpenSearch Indexing Throttle" + + - interval: 1m + input_series: + - series: 'opensearch_indices_indexing_is_throttled_bool{cluster="opensearch-x7zb"}' + values: '1x360' + alert_rule_test: + - eval_time: 2h + alertname: OpenSearchThrottlingTooLong + exp_alerts: + - exp_labels: + severity: critical + cluster: opensearch-x7zb + exp_annotations: + message: "Cluster opensearch-x7zb is throttling for at least two hours. Please review your indexing request rate, index lifecycle or consider scale the application." + summary: "OpenSearch Indexing Throttle too long"