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 upboolean expression only evaluates last element #2122
Comments
This comment has been minimized.
This comment has been minimized.
Add parens to force evaluation order. |
brian-brazil
added
the
kind/question
label
Oct 26, 2016
brian-brazil
closed this
Oct 30, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 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. |
lock
bot
locked and limited conversation to collaborators
Mar 24, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
brymatm commentedOct 26, 2016
What did you do?
Created the following recording rule and included it in my alerts:
What did you expect to see?
Did not expect to receive alerts outside of the specified hours.
What did you see instead? Under which circumstances?
At the time I wrote this, day_of_week() resolved to 3, hour() resolved to 11:
Received alerts outside of the specified hours for datafeeds undergoing nightly refreshes. When I manually input the expression in Prometheus I was surprised to see the expression returning 1 when the hour was less than 13. When I changed the order of the expression to this it returned 0 as expected:
When I drop the expression to two elements and change it so that the day of week should cause the expression to fail, it still only evaluates the last element of the expression:
(see attached images)
Environment
Linux 2.6.32-358.el6.x86_64 x86_64
prometheus, version 1.3.0-beta.0 (branch: master, revision: 5273b55)
build user: root@cb83e777216a
build date: 20161020-08:51:20
go version: go1.7.1