Closed
Description
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
- Support UTF-8 label matchers: Add new parser #3453
- Support UTF-8 label matchers: Add test for PromQL braces when parsing lists of matchers #3507 and Support UTF-8 label matchers: Add more acceptance tests for braces when using amtool #3523
- Support UTF-8 label matchers: Add compat package with feature flag and use in amtool #3483
- Support UTF-8 label matchers: Use compat package in Alertmanager server #3567
Metadata
Metadata
Assignees
Labels
No labels