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 upRemove scalar/scalar comparisons #482
Comments
brian-brazil
added
the
enhancement
label
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
|
Another option would be to make it filter. |
This comment has been minimized.
This comment has been minimized.
|
How would it filter? By returning an empty vector? What purpose would that serve? (but removing sounds good so far) |
This comment has been minimized.
This comment has been minimized.
|
It'd do the same as vector/vector, return the left argument. |
This comment has been minimized.
This comment has been minimized.
|
A use case has appeared for filtering scalar/scalar comparisons: restricting times when alerts fire via math on time(). Accordingly let's filter and take the left argument. |
This comment has been minimized.
This comment has been minimized.
|
As complaints about breaking changes are getting louder with time, we might want to make a decision on this in the next few weeks. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil I'm still not clear on how scalar/scalar would filter: if the return type is scalar as well, what would the return value be for something like |
This comment has been minimized.
This comment has been minimized.
|
Hmm, yeah you'd need to make the result of scalar/scalar comparisons to be vectors for it to work - which would break other things. That'd imply dropping support for it, and using absent({}) or maybe a one/iota/unity() function that returns a vector with a single no-label sample with value 1 for when you need to filter. |
This comment has been minimized.
This comment has been minimized.
|
Devil's advocate - would it make sense to drop scalars all together and parse a number literal as a single-element vector without labels? We'd have to allow unary expressions for vectors. Label matching simply wouldn't make sense as the label set is empty. This would naturally solve some issues such as not being able to graph a line when you type |
This comment has been minimized.
This comment has been minimized.
That'd require group_left/group_right on "scalar"/vector operations, which'd be too overbearing considering how common that is. |
This comment has been minimized.
This comment has been minimized.
|
Another thought is that a scalar/scalar comparison could return a vector, either empty or {}:left value |
brian-brazil
referenced this issue
Sep 2, 2015
Merged
promql: Add 'bool' modifier to comparison functions #1049
This comment has been minimized.
This comment has been minimized.
|
To summarize, we've two options to clean this up:
I'm tending towards the first, as that'll leave us the option of doing the second in future. I'm thinking this should be done the release after #1049 is released, to give users a chance to transition. |
brian-brazil
added this to the v0.17.0 milestone
Sep 26, 2015
This comment has been minimized.
This comment has been minimized.
|
0.16 will include bool, so we can drop scalar/scalar in 0.17. |
brian-brazil
referenced this issue
Oct 10, 2015
Merged
promql: Remove scalar/scalar comparisons. #1159
fabxc
closed this
in
#1159
Oct 16, 2015
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
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. |
brian-brazil commentedJan 27, 2015
Scalar == scalar is unlike vector == scalar and vector == vector in that it doesn't filter. To keep the language orthogonal and consistent, I propose we drop support for scalar/scalar comparisons. Any case where it would be useful should be doable via vectors.