Skip to content

Commit

Permalink
Merge pull request #804 from nsano-rururu/fix_spike_rule
Browse files Browse the repository at this point in the history
Fix SpikeRule
  • Loading branch information
jertel committed Apr 6, 2022
2 parents 73a9364 + 6607559 commit 4fe37e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion elastalert/ruletypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 4fe37e5

Please sign in to comment.