* Add adapter package for parser feature flag
This commit adds the compat package allowing users to switch
between the new matchers/parse parser and the old pkg/labels parser.
The new matchers/parse parser uses a fallback mechanism where if
the input cannot be parsed in the new parser it then attempts to
use the old parser. If an input is parsed in the old parser but
not the new parser, then a warning log is emitted.
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Add tests for PromQL braces when using amtool alert
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Add test for PromQL braces when parsing lists of matchers
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Use acceptance tests
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Add test creating silence with braces
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Fix scheme required for webhook url in amtool
This commit fixes issue #3505 where amtool would fail with
"error: scheme required for webhook url" when using amtool
with --alertmanager.url.
The issue here is that UnmarshalYaml for WebhookConfig checks
if the scheme is present when c.URL is non-nil. However,
UnmarshalYaml for SecretURL returns a non-nil, default value
url.URL{} if the response from api/v2/status contains <secret>
as the webhook URL.
Signed-off-by: George Robinson <george.robinson@grafana.com>
* Add test for config routes test
Signed-off-by: George Robinson <george.robinson@grafana.com>
---------
Signed-off-by: George Robinson <george.robinson@grafana.com>