问题
In a prometheus alert rule, how do I check for a value to be in a certain range?
for eg., (x > 80 && x <= 100);
when x is a complex expression it feels unnecessary to evaluate it twice. is there another way to represent this expression?
回答1:
You can do x < 100 > 80 to chain them.
来源:https://stackoverflow.com/questions/45766533/prometheus-rule-check-for-expression-value-in-range