Closed muff1nman closed 8 months ago
Noticed this as well, and it seems this was an explicit change as part of UTF-8 support and some promql grammar/exposition format changes:
Oops, yeah, that was introduced in https://github.com/prometheus/prometheus/pull/13271 . @ywwg there are legitimate uses of specifying the name multiple times inside the braces (to apply multiple regexp's). I'm afraid this will not only break promtool but the expression parsing in general.
Verified that this breaks parsing those expressions in general. @ywwg could you have a look here?
I think the fix here would be that the metric name cannot exist twice in the same selector for the equality operator -- can't do ="foo" and ="bar". OR, do we just want to remove the restriction completely and if someone does foo{"bar"}
(two metric name equality selectors with different values), we just let them?
looking at the code, I think it did already check for foo{__name__="bar"}
, but did not check for something like {__name__="foo",__name__="bar"}
What did you do?
The following promql is a valid expression in previous versions of promtool and when evaluated via prometheus:
What did you expect to see?
promtool check rules
should successfully validate the given rules.What did you see instead? Under which circumstances?
However with the latest promtool this expression is no longer validating succesfully:
System information
No response
Prometheus version
No response
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response