-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add negative matchers for routing. #2434
Conversation
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
51e15df
to
4886074
Compare
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big picture: In principle, things should work as you have done here, but I think we should go one step further and fully embrace the labels.Matcher
for matchers in the config (but not (yet) for matchers in silences, see comments for details). We can talk 1:1 about it if you have questions. (I have found a few issues with the labels.Matcher
while looking at the code, which we can also discuss in person.)
"Operational" note: In this PR, you effectively ignore a parsing error twice. It's a good general rule for Go code to only ignore errors if you know exactly why, and then add a comment explaining why it is fine to ignore the error. (Spoiler: In these two cases, it's not fine…)
The alert was just looking at the minimum across integrations. So a complete failure of one integration would be masked by a still worknig other integration. With this fix, the `integration` label is retained (as it was already expected by the `description`), and thus any failing integration will trigger the alert. In addition, an `alertmanagerCriticalIntegrationsRegEx` is provided that allows to mark integrations as critical. Integrations that are not used to deliver critical alerts, or those that are just there for auditing and logging purposes can now be configured to only trigger a warning alert if they fail. Signed-off-by: beorn7 <beorn@grafana.com>
The doc comments do not describe the current (arguably buggy) state, but the desired state, as it will be implemented in future commits. Signed-off-by: beorn7 <beorn@grafana.com>
This addresses a number of issues: - It was impossible to include a literal '"' or a line break in the value. - It was impossible to include '=', '~', or '!' in the value. - It was not validated if the label name is valid. - It was not validated if the value is valid UTF-8. - No whitespace was allowed around the operator. Signed-off-by: beorn7 <beorn@grafana.com>
Previously, escaped double quotes would still be seen as ending the quoting, potentially leading to wronk tokenization. Signed-off-by: beorn7 <beorn@grafana.com>
Signed-off-by: beorn7 <beorn@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great in general, just minor things to tweak.
Keep in mind that we also need to update the documentation, but we can do that after the next PR that updates the inhibition rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found an actual issue after all, see comments.
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, just an issue with marshaling.
Now the string created will correctly parse back. Signed-off-by: beorn7 <beorn@grafana.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Cool. Besides that minor issue about sorting by @simonpasquier could you give this a final look? Note that ideally, this gets merged together with #2441, where I'd appreciate your review, too. |
Signed-off-by: beorn7 <beorn@grafana.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
Improve labels.Matcher
In the same spirit as #2441, I'll merge this now. |
Signed-off-by: beorn7 <beorn@grafana.com>
Signed-off-by: aSquare14 atibhi.a@gmail.com
Related issue : #1023
Note : I am adding negative matchers for routing in this PR. Will add support for inhibition rules in next PR.