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 upbetter PromQL syntax documentation #3697
Comments
This comment has been minimized.
This comment has been minimized.
deeTEEcee
commented
Aug 30, 2018
•
|
I figure I'd just add on to this for more syntax/documentation-related issues. Background Suggestion |
This comment has been minimized.
This comment has been minimized.
|
Yip, looks like we forgot to document many-to-many matching. |
This comment has been minimized.
This comment has been minimized.
douardda
commented
Dec 11, 2018
•
|
I agree that a proper syntax definition is missing. In my case, reading the doc, I see no reason why edit: this side note part of my comment seems to be the subject of #1227 |
This comment has been minimized.
This comment has been minimized.
This is documented, "Syntactically, a range duration is appended in square brackets ([]) at the end of a vector selector ". |
This comment has been minimized.
This comment has been minimized.
douardda
commented
Dec 11, 2018
|
@brian-brazil you are right, but for a promql newbie (like me), this is far from obvious. Naively I was expecting selected instant vector and "built" ones (typically resulting from the application of a binary op) to be the same class of citizen. |
This comment has been minimized.
This comment has been minimized.
|
They are, however a vector selector is not the same as a vector. |
This comment has been minimized.
This comment has been minimized.
douardda
commented
Dec 11, 2018
|
Yes, I do now understand that the range vector is built from an instant vector selector and and not an instant vector. And if I don't really understand why it is that way rather than the other (range is built from an instant vector), reading at #1227 it looks this is more difficult than it may see. I get it. May be a more explicit warning in the documentation would help. Anyway thanks for your quick responses. |
rogpeppe commentedJan 17, 2018
I recently tried to form a query that failed with a parse error, but I'm not sure why it did.
As the query language documentation is mostly by example, I have no clear idea what the syntax of the query language actually is.
My specific example was that it's not clear what syntactic role an instance vector selector takes and hence how it can be applied. I had a vector expression
rate(jem_monitor_errors_count[1m])that I wanted only one component of, so I thought thatrate(jem_monitor_errors_count[1m]){instance="instance-name"}would work, but I getparse error at char 37: could not parse remaining input \"{instance=\\\"in\"...", which I find odd becausejem_monitor_errors_count{instance="instance-name"}works fine.It would be great to have the PromQL grammar available as a reference doc (ideally in some kind of BNF notation), so people like me don't come bugging the prometheus issues with probably-stupid questions like this.
PS I realised that I could fix the issue by applying the instance vector selector to the inner expression, but I think my point remains - the syntax is not clearly documented so we have to guess.