New test for validation with dots#759
New test for validation with dots#759ArthurSens merged 2 commits intoprometheus:mainfrom m1k1o:feature/test-validation-with-dots
Conversation
Signed-off-by: Miroslav Šedivý <[email protected]>
I would reword this because the use of "correct" and "adds dots" are misleading: curling without setting the Accept headers to indicate that your endpoint supports UTF-8 names yields results that match the behavior you expected because the library is escaping the names as it did in previous versions. However with the Accept header that indicates support for utf-8, the library does not escape the names and instead allows them through as-is. Dots are not being "added" anywhere, they are no longer being escaped to underscores. This behavior is already tested in numerous places but if it helps to have this one as well that's ok by me. |
|
for your situation, you probably want to set the |
Signed-off-by: Miroslav Šedivý <[email protected]>
|
@ywwg setting |
|
Ping @beorn7. |
Since in v0.62.0 was introduced a new validation, that was advised as a breaking change, it indeed it was transparent breaking change for me.
I am using OTEL that is exporting metrics via prometheus. They contain dots in the name e.g.
module.submodule.metric_name. Up until this change, they were changed tomodule_submodule_metric_nameand everything worked properly.Since this breaking change, they do contain the dot. However, only when requesting metrics with
escaping=allow-utf-8what is prometheus doing by default.It was tricky to find the root of this behavior change, since
curl 127.0.0.1:9000/metricsyields correct results, butcurl -H 'Accept: text/plain;escaping=allow-utf-8' 127.0.0.1:9000/metricsadds dots to the name.I don't know if this change was intended, if I should change my metrics everywhere to include the dot or not. In any case, I just added tests to validate with dots so the expected behavior is defined in tests.