Skip to content
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

New `bool` modifier not working in recording rules #1065

Closed
juliusv opened this Issue Sep 9, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@juliusv
Copy link
Member

juliusv commented Sep 9, 2015

For example, try the expression up > bool 0 with some up and down targets. It works fine in the expression browser, but in a recorded rule it acts like the bool isn't there.

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Sep 9, 2015

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Sep 9, 2015

The status page also shows newup{} = up > 0 instead of newup{} = up > bool 0.

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Sep 9, 2015

So for the printed text, I guess we just need new printing logic in https://github.com/prometheus/prometheus/blob/master/promql/printer.go. Still doesn't explain the different evaluation behavior between rules and interactive queries though.

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Sep 9, 2015

Argh. The printer is indeed the culprit, it seems. Look at this line in recording.go:

https://github.com/prometheus/prometheus/blob/master/rules/recording.go#L47

IMO having to go through serializing and deserializing an expression again internally to evaluate it for a recording rule is quite a wart. Would it be possible to keep it in symbolic form instead and only use the printer-generated serializations for user-targeted output?

juliusv added a commit that referenced this issue Sep 9, 2015

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Sep 10, 2015

This was a 'good for now' solution. We can certainly keep the AST node directly in rules.

gouthamve pushed a commit to gouthamve/promql that referenced this issue Mar 28, 2018

@lock

This comment has been minimized.

Copy link

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 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.
You can’t perform that action at this time.