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
Improve scalar literal format documentation #7651
Conversation
Signed-off-by: Julius Volz <julius.volz@gmail.com>
Thanks for pointing out this bug :) #5984 should be probably applied to PromQL too :) |
Mmmh it seems like we are not affected by #5984 in promql. However, I suggest we note that we do not support these. |
-2.43 | ||
3.4e-9 | ||
0x8f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this something we actually support? I think we should stick to basic floats and ints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not support that and #5984 made sure we do not scrape that either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait,yes we support that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, this is not something we support. https://github.com/prometheus/prometheus/blob/master/promql/parser/lex.go#L717
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it is
docs/querying/basics.md
Outdated
0x8f | ||
-Inf | ||
|
||
Prometheus first attempts to parse scalar literals using Go's [`strconv.ParseInt()`](https://golang.org/pkg/strconv/#ParseInt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be mentioning implementation details like this, also it's the PromQL grammar that defines this - not the Go implementation.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
It's funny how nobody was even sure what kind of number formats Prometheus accepts, good that we are documenting this :) I removed the references to Go now and included a regex-based approach instead. |
👍 |
* Improve scalar literal format documentation Signed-off-by: Julius Volz <julius.volz@gmail.com> * Address review comments Signed-off-by: Julius Volz <julius.volz@gmail.com> * Fixup Signed-off-by: Julius Volz <julius.volz@gmail.com> Signed-off-by: kangwoo <kangwoo@gmail.com>
Signed-off-by: Julius Volz julius.volz@gmail.com