alertmanager/config
George Robinson 848e2191d9
Support UTF-8 label matchers: Add metrics to matchers compat package (#3658)
* Add metrics to matchers compat package

This commit adds the following metrics to the compat package:

  alertmanager_matchers_parse
  alertmanager_matchers_disagree
  alertmanager_matchers_incompatible
  alertmanager_matchers_invalid

With a label called origin to differentiate the different sources
of inputs: the configuration file, the API, and amtool.

The disagree_total metric is incremented when an input is invalid
in both parsers, but results in different parsed representations,
then there is disagreement. This should not happen, and suggests
their is either a bug in one of the parsers or a mistake in the
backwards compatible guarantees of the matchers/parse parser.

The incompatible_total metric is incremented when an input is valid
in pkg/labels, but not the UTF-8 parser in matchers/parse. In such
case, the matcher should be updated to be compatible. This often
means adding double quotes around the right hand side of the matcher.
For example, foo="bar".

The invalid_total metric is incremented when an input is invalid
in both parsers. This was never a valid input.

The tests have been updated to check the metrics are incremented
as expected.

Signed-off-by: George Robinson <george.robinson@grafana.com>

---------

Signed-off-by: George Robinson <george.robinson@grafana.com>
2024-01-05 10:21:20 +00:00
..
receiver Separate and export BuildReceiverIntegrations (#3553) 2023-10-17 14:45:44 +01:00
testdata Add support for reading VictorOps API key from file (#3111) 2022-10-25 15:40:17 +02:00
config.go Support UTF-8 label matchers: Add metrics to matchers compat package (#3658) 2024-01-05 10:21:20 +00:00
config_test.go Changes receiver and inhibition rules arrays to slices of value items 2023-01-18 10:21:51 -05:00
coordinator.go Update golangci-lint and fix complaints (#2853) 2022-03-25 17:59:51 +01:00
coordinator_test.go Update go dependencies & switch to go-kit/log 2021-08-02 12:43:23 +02:00
notifiers.go use Go standard errors 2023-12-08 16:44:13 +01:00
notifiers_test.go Merge pull request #3226 from an5t/telegram-token-file 2023-04-06 17:15:17 +02:00