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"on ()" keyword ignored in alert IF statement when loaded from rules file #2082
Comments
grobie
added
area/usability
kind/bug
component/ui
component/promql
labels
Oct 13, 2016
This comment has been minimized.
This comment has been minimized.
|
The issue is that the printer only shows vector matching related keywords if any matching labels are provided. I guess we'll need a way to indicate whether a field was set, bool pointers or an additional field come to my mind. |
brian-brazil
added a commit
that referenced
this issue
Oct 19, 2016
brian-brazil
closed this
in
#2096
Oct 19, 2016
brian-brazil
added a commit
that referenced
this issue
Oct 19, 2016
beorn7
added a commit
that referenced
this issue
Oct 28, 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 13, 2016
What did you do?
I added lines similar to the following (one recording rule, multiple alerts) to my rules file and restarted my Prometheus server:
workhours=day_of_week() < bool 6 * hour() >= bool 13 * hour() < bool 22
ALERT rateAlert_server_datafeed
IF rate(server_datafeed[10m]) == 0 and on () workhours == 1
LABELS { topic = "datafeed", }
ANNOTATIONS {
summary = "Topic datafeed on {{ $labels.job }} has not received a message for at least 10 minutes",
subject = "No messages for topic datafeed on {{ $labels.job }}",
}
What did you expect to see?
On the Prometheus Status|Rules page I expected to see something like this:
workhours{} = day_of_week() < BOOL 6 * hour() >= BOOL 13 * hour() < BOOL 22
ALERT rateAlert_server_datafeed
IF rate(server_datafeed[10m]) == 0 and on () workhours == 1
LABELS {topic="datafeed"}
ANNOTATIONS {subject="No messages for topic datafeed on {{ $labels.job }}", summary="Topic datafeed on {{ $labels.job }} has not received a message for at least 10 minutes"}
What did you see instead? Under which circumstances?
On the Prometheus Status|Rules page I saw something like this with the IF statement missing the "on ()" keyword:
workhours{} = day_of_week() < BOOL 6 * hour() >= BOOL 13 * hour() < BOOL 22
ALERT rateAlert_server_datafeed
IF rate(server_datafeed[10m]) == 0 and workhours == 1
LABELS {topic="datafeed"}
ANNOTATIONS {subject="No messages for topic datafeed on {{ $labels.job }}", summary="Topic datafeed on {{ $labels.job }} has not received a message for at least 10 minutes"}
Environment
Linux 2.6.32-358.el6.x86_64 x86_64
prometheus, version 1.2.1 (branch: master, revision: dd66f2e)
build user: root@fd9b0daff6bd
build date: 20161010-15:58:23
go version: go1.7.1