Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[Discussion] CASE on top of IF in alert definitions? #3025
Comments
RichiH
referenced this issue
Aug 7, 2017
Closed
[Discussion] CASE on top of IF in alert definitions? #942
This comment has been minimized.
This comment has been minimized.
|
We have just solved a similar-looking use-case at SoundCloud with stock PromQL. We have defined some "static" rules that contain the labels to attach and the label we want to decide on if said labels should be attached, e.g.
In the above example, The whole thing is a bit arcane, but maintenance is easy for our users (just modify/add/remove static rules), and the use-case is probably sufficiently rare/advance to justify a bit of PromQL magic. |
This comment has been minimized.
This comment has been minimized.
|
That use is something I ensured was supported when the group_left logic was changed. It's presently only documented in a unittest: https://github.com/prometheus/prometheus/blob/master/promql/testdata/operators.test#L325-L335 |
This comment has been minimized.
This comment has been minimized.
|
Adding @bastischubert Interesting; will test this internally. |
This comment has been minimized.
This comment has been minimized.
|
Given this is already possible in a reasonable way via promql, that this is getting into offering more than one way to do things (we already have IF), and more complex cases will require configuration management an/or complex PromQL anyway I don't think this is something we should ever add. |
brian-brazil
closed this
Aug 21, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
RichiH commentedAug 7, 2017
Having a diverse environment with different SLAs towards customers, we need to duplicate quite a lot of alert rules to account for different severities, escalation paths, or even ignoring some things.
If we had a CASE stanza which allowed us to define the matching rules and then, in a second step, decide what labels to attach, finished by a catchall for anything we didn't match, would save quite a bit of effort.
I do think that there should be a mandatory catchall to make sure people don't fully handle alarms by mistake.
@brian-brazil argues that this "can be handled with configuration management"
My argument would be that this is an orthogonal issue. It would be easier to create distinct definitions from config management and the amount of config text does not matter when autogenerated and never looked at. But in reality, humans will verify the alert rules on a regular basis, and a truly heterogenic environment will always require a few one-offs; both of which are better handled by humans who appreciate not needing to read, or write, autogenerated text.