From 889a42995f1a498bd0476539807c879ec1461e70 Mon Sep 17 00:00:00 2001 From: nsano-rururu Date: Wed, 6 Apr 2022 00:27:51 +0900 Subject: [PATCH 1/2] Fix SpikeRule --- elastalert/ruletypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elastalert/ruletypes.py b/elastalert/ruletypes.py index ef9d626c..0659364c 100644 --- a/elastalert/ruletypes.py +++ b/elastalert/ruletypes.py @@ -448,7 +448,7 @@ def get_spike_values(self, qk): extending ref/cur value retrieval logic for spike aggregations """ spike_check_type = self.rules.get('metric_agg_type') - if spike_check_type in [None, 'sum', 'value_count']: + if spike_check_type in [None, 'sum', 'value_count', 'cardinality', 'percentile']: # default count logic is appropriate in all these cases return self.ref_windows[qk].count(), self.cur_windows[qk].count() elif spike_check_type == 'avg': From 6607559b42f152cd0c4f40290a110163d2962568 Mon Sep 17 00:00:00 2001 From: nsano-rururu Date: Wed, 6 Apr 2022 00:30:24 +0900 Subject: [PATCH 2/2] Update ChangeLog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 712764b6..14015cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Update schema.yaml(Alertmanager, Spike, Flatline, New Term, Metric Aggregation, Percentage Match) - [#789](https://github.com/jertel/elastalert2/pull/789) - @nsano-rururu - Upgrade pylint 2.13.2 to 2.13.3 - [#792](https://github.com/jertel/elastalert2/pull/792) - @nsano-rururu - Upgrade pylint 2.13.3 to 2.13.4 - [#801](https://github.com/jertel/elastalert2/pull/801) - @nsano-rururu +- Fix SpikeRule - [#804](https://github.com/jertel/elastalert2/pull/804) - @nsano-rururu # 2.4.0