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

Improve scalar literal format documentation #7651

Merged
merged 3 commits into from Jul 25, 2020
Merged

Conversation

juliusv
Copy link
Member

@juliusv juliusv commented Jul 23, 2020

Signed-off-by: Julius Volz julius.volz@gmail.com

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@roidelapluie
Copy link
Member

roidelapluie commented Jul 23, 2020

Thanks for pointing out this bug :)

#5984 should be probably applied to PromQL too :)

@roidelapluie
Copy link
Member

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
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it is

0x8f
-Inf

Prometheus first attempts to parse scalar literals using Go's [`strconv.ParseInt()`](https://golang.org/pkg/strconv/#ParseInt)
Copy link
Contributor

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>
@juliusv
Copy link
Member Author

juliusv commented Jul 25, 2020

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.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@brian-brazil
Copy link
Contributor

👍

@juliusv juliusv merged commit 9da59c8 into master Jul 25, 2020
@juliusv juliusv deleted the fix-scalar-literal-docs branch July 25, 2020 11:34
kangwoo pushed a commit to kangwoo/prometheus that referenced this pull request Jul 31, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants