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 up<labelvalue>: a string of unicode characters accepts booleans and promtool validation succeeds #4439
Comments
vsliouniaev
changed the title
<labelvalue>: a string of unicode characters accepts booleans
<labelvalue>: a string of unicode characters accepts booleans and promtool validation succeeds
Jul 31, 2018
This comment has been minimized.
This comment has been minimized.
|
Does Prometheus correctly parse this as a string? |
This comment has been minimized.
This comment has been minimized.
|
Yes, Prometheus accepts this also |
This comment has been minimized.
This comment has been minimized.
|
That doesn't sound like a bug on our end then. Promtool is meant to verify that the config will be parsed by Prometheus. |
This comment has been minimized.
This comment has been minimized.
|
Is this a spec bug then? (-: |
This comment has been minimized.
This comment has been minimized.
|
When I load this rule file into Prometheus, it produces string output labels on the alert: |
This comment has been minimized.
This comment has been minimized.
|
Per the JSON spec they are separate things. |
This comment has been minimized.
This comment has been minimized.
|
@vsliouniaev I stared at http://yaml.org/spec/1.2/spec.html for a while today, but it's too cryptic for me to understand whether it's illegal for a YAML parser to treat the unquoted |
vsliouniaev commentedJul 31, 2018
Proposal
promtool should validate labels in a more restrictive fashion. Currently it's possible to use non-string values, but the spec says otherwise.
Use case. Why is this important?
For better interoperability that follow the Prometheus spec. For example, when submitting rule files that contain booleans to the prometheus-operator CRDs the tool fails to serialize them.
Bug Report
What did you do?
What did you expect to see?
What did you see instead? Under which circumstances?
Environment