Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SpikeRule #804

Merged
merged 2 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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