{"action":"created","issue":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/136","repository_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin","labels_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/136/comments","events_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/136/events","html_url":"https://github.com/sensu-plugins/sensu-plugin/pull/136","id":159999377,"number":136,"title":"[WIP] deprecate event occurrence filtering in Sensu::Handler","user":{"login":"cwjohnston","id":148017,"avatar_url":"https://avatars.githubusercontent.com/u/148017?v=3","gravatar_id":"","url":"https://api.github.com/users/cwjohnston","html_url":"https://github.com/cwjohnston","followers_url":"https://api.github.com/users/cwjohnston/followers","following_url":"https://api.github.com/users/cwjohnston/following{/other_user}","gists_url":"https://api.github.com/users/cwjohnston/gists{/gist_id}","starred_url":"https://api.github.com/users/cwjohnston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwjohnston/subscriptions","organizations_url":"https://api.github.com/users/cwjohnston/orgs","repos_url":"https://api.github.com/users/cwjohnston/repos","events_url":"https://api.github.com/users/cwjohnston/events{/privacy}","received_events_url":"https://api.github.com/users/cwjohnston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/milestones/2","html_url":"https://github.com/sensu-plugins/sensu-plugin/milestones/v1.4.0","labels_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/milestones/2/labels","id":1811425,"number":2,"title":"v1.4.0","description":"","creator":{"login":"cwjohnston","id":148017,"avatar_url":"https://avatars.githubusercontent.com/u/148017?v=3","gravatar_id":"","url":"https://api.github.com/users/cwjohnston","html_url":"https://github.com/cwjohnston","followers_url":"https://api.github.com/users/cwjohnston/followers","following_url":"https://api.github.com/users/cwjohnston/following{/other_user}","gists_url":"https://api.github.com/users/cwjohnston/gists{/gist_id}","starred_url":"https://api.github.com/users/cwjohnston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwjohnston/subscriptions","organizations_url":"https://api.github.com/users/cwjohnston/orgs","repos_url":"https://api.github.com/users/cwjohnston/repos","events_url":"https://api.github.com/users/cwjohnston/events{/privacy}","received_events_url":"https://api.github.com/users/cwjohnston/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":4,"state":"open","created_at":"2016-06-06T17:00:36Z","updated_at":"2016-07-13T19:54:44Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-06-13T17:07:42Z","updated_at":"2016-07-14T14:21:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/pulls/136","html_url":"https://github.com/sensu-plugins/sensu-plugin/pull/136","diff_url":"https://github.com/sensu-plugins/sensu-plugin/pull/136.diff","patch_url":"https://github.com/sensu-plugins/sensu-plugin/pull/136.patch"},"body":"## Description\r\nThe `filter_repeated` method in this library implements logic known as event occurrence filtering by comparing `refresh` and `occurrences` attributes.\r\n\r\nThis change adds logic which honors the `check.use_deprecated_filtering` attribute on check results. When `check.use_deprecated_filtering` is explicitly set to `false`, the event occurrence filtering in this library will be skipped.\r\n\r\nWhen check results are to be processed by the `filter_repeated` method (enabled by default), a warning will be logged indicating that sensu-plugin event occurrence filtering is deprecated.\r\n\r\nThe `filter_disabled`, `filter_dependencies` and `filter_silenced` methods will continue to be applied to events. \r\n\r\n## Motivation and Context\r\n\r\nAs documented in #134, deprecating and eventually removing the `filter_repeated` behavior of sensu-plugin will transfer more control to operators instead of trying to cover all cases via this library.\r\n\r\n## How Has This Been Tested?\r\n\r\nAdded tests to validate that the deprecation warning message is printed to stdout by default and is not printed when check attribute `use_deprecated_filtering` is set to `false`\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [ ] I have updated the Changelog following the conventions laid out on [Keep A Changelog](http://keepachangelog.com/)\r\n\r\n## Known Caveats\r\n\r\nEdit: I've updated the description of this PR to reflect that we've narrowed the focus of this change to the event occurrence filtering in the `filter_repeated` method."},"comment":{"url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/comments/232679644","html_url":"https://github.com/sensu-plugins/sensu-plugin/pull/136#issuecomment-232679644","issue_url":"https://api.github.com/repos/sensu-plugins/sensu-plugin/issues/136","id":232679644,"user":{"login":"CVTJNII","id":13871930,"avatar_url":"https://avatars.githubusercontent.com/u/13871930?v=3","gravatar_id":"","url":"https://api.github.com/users/CVTJNII","html_url":"https://github.com/CVTJNII","followers_url":"https://api.github.com/users/CVTJNII/followers","following_url":"https://api.github.com/users/CVTJNII/following{/other_user}","gists_url":"https://api.github.com/users/CVTJNII/gists{/gist_id}","starred_url":"https://api.github.com/users/CVTJNII/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CVTJNII/subscriptions","organizations_url":"https://api.github.com/users/CVTJNII/orgs","repos_url":"https://api.github.com/users/CVTJNII/repos","events_url":"https://api.github.com/users/CVTJNII/events{/privacy}","received_events_url":"https://api.github.com/users/CVTJNII/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T14:21:05Z","updated_at":"2016-07-14T14:21:05Z","body":"I'm :-1: on this scope change.  The problem I'm seeing is that filtering in the handler is very expensive, not because the filtering itself is expensive but because spinning up the Ruby process is.  So keeping filtering at the handler level still leaves the problems I documented in sensu/sensu#1341.\r\n\r\nI would like to see all filtering removed from the handlers.  In my opinion filtering should be handled in a long lived process, not something launched on each event, so that the handlers aren't load bombs waiting to go off when a major outage occurs.  Whether this is core or not doesn't matter too much.\r\n\r\nMy current solution is to make a long lived process which does the filtering, and then handles launching the handlers only when the event is unfiltered.  This currently results in two different processes evaluating if the event should be filtered, which I consider risky.  I was excited by the original scope of this as it would allow me to disable the duplicated filter code in the handlers, ensuring the handler will always alert on whatever it's passed and not second-guess my main filter process.  I would strongly like to see the ability to disable all filtering maintained."}}
{"actor":{"display_login":"CVTJNII"}}