Closed somic closed 8 years ago
Whoa! If this works this would be a massive cpu saving filter!
I say ship, I don't really know enough about sensu extensions to really review thoroughly.
My only other reservation is that we have tested the crap out of this logic in the base handler, and I would like to see that carried over if possible. It "feels" pretty easy to mess up this logic, and we have hit quite a few bugs with it and the tests really helped. I'm ok with them being duplicated in the short term.
Code is copy-paste of filter_repeated from base.rb, with small modifications that should not impact logic.
I will try to port all rspec tests from https://github.com/Yelp/sensu_handlers/blob/master/spec/functions/base_spec.rb#L161 (context "check filter_repeated") in addition to tests I already have and then will merge.
This moves some filtering logic from handlers to a sensu extension filter that will run inside sensu-server process.
sensu extension was tested internally with a noop handler.
By default this is off and can be enabled in hiera per host or per region, etc.