You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered this issue after I wrote instrumentation code that outpus hexadecimal floats, and then noticed that Prometheus unexpectedly (and I believe contrary to spec) rejected them.
System information
No response
Prometheus version
2.30.3
(My distribution broke prometheus --version; I do not think this is crucial, since the relevant code seems to have been unchanged for multiple years.)
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
This is a documentation change rather than a code change. I will move this issue to the documentation repository for further review and update the spec accordingly.
What did you do?
$ echo 'testmetric 0x1p0' | promtool check metrics
What did you expect to see?
testmetric no help text
According to https://prometheus.io/docs/instrumenting/exposition_formats/ , valid input to https://pkg.go.dev/strconv#ParseFloat should be a valid metric value.
Go's ParseFloat supports hexademical fp numbers, like e.g. "0x1p0"
What did you see instead? Under which circumstances?
error while linting: text format parsing error in line 1: expected float as value, got "0x1p0"
Prometheus, contrary to go's ParseFloat() does not support hexademical fp values, due to them containing a 'p'.
(I believe this is due to https://github.com/prometheus/common/blob/ca1f99be33b31b804a85a42cb7d3a1df23500bf8/expfmt/text_parse.go#L771 )
I encountered this issue after I wrote instrumentation code that outpus hexadecimal floats, and then noticed that Prometheus unexpectedly (and I believe contrary to spec) rejected them.
System information
No response
Prometheus version
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response
The text was updated successfully, but these errors were encountered: