Comments (2)
Also the sensu documentation says that the annotations are at check.annotations, so I should be missing something.
Aren't the event received by the filter and the event that is received by the handler the same (without any mutator)?
Actually no, they are not. Filters are ran inside an Otto javascript VM within the Sensu backend and the version of the event they are passed has the annotations (and other metadata) at the top level of the check and entity objects. They are moved into the ObjectMeta (metadata) before they are sent to the handler(s).
As for the issue of the filter never letting it pass, let's look at all of the filters you have applied, at least to the one handler definition you provided:
filters:
- is_incident
- not_silenced
- state_change_only
- fatigue_check
Let's review these in order, minus the not_silenced
filter as it is not coming into play for what you are seeing:
The is_incident
filter "allows only warning ("status": 1), critical ("status": 2), and resolution events to be processed."
The state_change_only
filter I assume you got from the docs. So that will only pass through events on the first occurrence.
Finally the fatigue_check
filter with annotations set to 2 occurrences, 1 hour interval, and no is_resolution
events.
So on first failure of a check (occurrences = 1, status = 2) the is_incident
filter will pass this as true, the state_change_only
filter will pass this is true, but finally the fatigue_check
filter will return false because occurrences != 2 and the event is dropped and not sent to the handler.
On the next interval, if still critical (occurrences = 2, status 2), the is_incident
filter will pass this as true, however the state_change_only
filter will return false since occurrences != 1. The fatigue_check
filter is not ran because we've already received a false from the prior filter. This event is dropped and not sent to the handler.
Let's say on the next interval the problem is corrected and we now have (occurrences = 1, status = 0, is_resolution = true). The is_incident
filter will pass this as true due to is_resolution
being true. state_change_only
will pass it as true since occurrences == 1, however since you have allow_resolution
set to false in the annotations, the fatigue_check
filter would return false and the event would get dropped and not sent to the handler.
Personally, I would suggest dropping the state_change_only
filter and you should then start to see events passed to your handlers as you would expect.
from sensu-go-fatigue-check-filter.
Yes! you are right! The state_change_only filter was causing the problem. It's pretty obvious now thanks to your explanation.
Also i haven't heard about the otto VM I will investigate it
You saved me a lot of time, thank you very much!
from sensu-go-fatigue-check-filter.
Related Issues (15)
- Need to properly deal with disparity of check interval and filter check interval
- Filter blocks every message random logs HOT 4
- Update docs to include bonsai integration (sensuctl asset add) in examples
- Feature request: Add support for filtering based on entity annotations HOT 2
- incorrect notification interval HOT 3
- Feature request: Option to change default values HOT 5
- Issues with default parameters HOT 3
- Find a way to test with Otto as well
- Ability to set defaults with annotations HOT 5
- Allow alerts which do not repeat HOT 2
- Resolution events not suppressed. HOT 5
- Alert on occurrences only when within a time window HOT 2
- Fix to work with cron scheduled checks HOT 1
- Annotations precedence convention working opposite of sdk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sensu-go-fatigue-check-filter.