-
Notifications
You must be signed in to change notification settings - Fork 490
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
Change Alert Levels to be independent instead of subsets. #298
Comments
@yosiat
And the highest matching level will be chosen. The advantage of assuming that each level is a subset of the previous level is that you can break out early and not evaluate every condition. From the docs While it is possible for the problem to be computed in the other direction since expressions can be stateful the current behavior made the most since as each higher level will only be evaluated on the data set the passed the previous level. |
@nathanielc Let's take an example: we have stream of "number_of_exceptions" which increments when the application server has an alert while processing, and we want to check that the exceptions isn't above some threshold.
For this case we will have info, in that case my alert levels aren't successive and I don't know how to create alert for this. And of course there is the opposite case - I want to check if I have some data and I want to warn if it's 1 and send critical value is less than 1 ( => no data) |
@nathanielc I finally solved this by separating the alert to multiple alerts like this:
What do you think? |
Wouldn't this work too? stream
.from().measurement('number_of_exceptions')
.alert()
.id('NumberOfExceptions')
.info(lambda: TRUE)
.warn(lambda: "value" >= 1)
.crit(lambda: "value" > 1)
.log('/Volumes/Data/influx/alerts.log') |
@nathanielc This would work, but my tick script are auto generated (converter from legacy system), so this is the best solution I have. |
Ok, I am thinking we might change this to be a mix of our implementations. Since it can be confusing that lower levels need to be a super set of higher levels what if we evaluate every level every time? That way its simple and you always know that each point will be evaluated for all levels. It will be slower but we are taking a max of four levels and simplicity is probably more important than a slight optimization. Thoughts? |
@nathanielc I agree, I think we need first measure this - to know how much does it hearts on performance and then decide upon this, but I prefer simplicity over performance. |
For now we are going to leave the behavior as is, since there hasn't been a strong push to change it. We can revisit later if need be. |
OK, I keep running into issues where the subset logic is annoying and requires that you work around it. I am going to reopen this issue. |
Hi,
I have the next tick script:
I am injecting data using this script:
And I am getting two alerts triggered OK and INFO, and I expected WARN to jump as well.
I debugged alert source code and found some issues with code (and I can submit pull request):
I modified the code to be like this:
@nathanielc What do you think? do you want PR?
The text was updated successfully, but these errors were encountered: