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
To support UTF-8 label matchers in Alertmanager we have restricted the grammar for label matchers and written a new LL(1) parser to parse this grammar. Our motivation for doing this, instead of extending the existing regular expression parser, is that we found a number of ambiguities in the existing grammar and parser that would have been made worse if we added support for UTF-8 label matchers. You can find a presentation that explains these ambiguities here.
Examples of ambiguities
{foo=}} equivalent to {foo="}"}, but I think this should be an error
{{foo=} is an error because of two {{, unlike the above
{foo=~} could be either {foo=~""} or {foo="~"}, it's interpreted in current versions as {foo=~""}
{foo=,} is equivalent to {foo=""}, but I think should be an error as a comma with no value has a high likelihood of being human error
{foo=,,} is an error, unlike {foo=,} or {foo=}}
{foo= } is equivalent to {foo=""}
{foo= }b is equivalent to {foo="}b"}
{foo= b} and {foo=b } are equivalent to {foo="b"}, but {foo=b b} is equivalent to {foo="b b"}
Example
Can parse?
{foo=bar😊}
✅
{foo="bar😊"}
✅
{foo😊=bar}
❌
{"foo😊"=bar}
✅
Here bar😊 is allowed on the right hand side of the expression without quotes but not the left.
grobinson-grafana
changed the title
Support UTF-8 names and values in label matchers
Epic: Support UTF-8 characters in Alertmanager label matchers
Jul 1, 2024
What
The Prometheus maintainers have agreed to support UTF-8 label matchers in Alertmanager. This issue tracks the work being done to deliver this change in Alertmanager.
Background
To support UTF-8 label matchers in Alertmanager we have restricted the grammar for label matchers and written a new LL(1) parser to parse this grammar. Our motivation for doing this, instead of extending the existing regular expression parser, is that we found a number of ambiguities in the existing grammar and parser that would have been made worse if we added support for UTF-8 label matchers. You can find a presentation that explains these ambiguities here.
Examples of ambiguities
Here
bar😊
is allowed on the right hand side of the expression without quotes but not the left.Tasks
The text was updated successfully, but these errors were encountered: