Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epic: Support UTF-8 characters in Alertmanager label matchers #3486

Closed
4 tasks done
grobinson-grafana opened this issue Aug 24, 2023 · 0 comments
Closed
4 tasks done

Comments

@grobinson-grafana
Copy link
Contributor

grobinson-grafana commented Aug 24, 2023

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

{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.

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant