Alerting: Allow more characters in label names so notifications are sent (#38629)

Remove validation for labels to be accepted in the Alertmanager, This helps with datasources that produce non-compatible labels.

Adds an "object_matchers" to alert manager routers so we can support labels names with extended characters beyond prometheus/openmetrics. It only does this for the internal Grafana managed Alert Manager.

This requires a change to alert manager, so for now we use grafana/alertmanager which is a slight fork, with the intention of going back to upstream.

The frontend handles the migration of "matchers" -> "object_matchers" when the route is edited and saved. Once this is done, downgrades will not work old versions will not recognize the "object_matchers".

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
This commit is contained in:
gotjosh
2021-10-04 14:06:40 +01:00
committed by GitHub
parent 706a665240
commit 6572017ec7
16 changed files with 740 additions and 188 deletions

View File

@@ -89,12 +89,17 @@ export type Receiver = {
[key: string]: any;
};
type ObjectMatcher = [name: string, operator: MatcherOperator, value: string];
export type Route = {
receiver?: string;
group_by?: string[];
continue?: boolean;
object_matchers?: ObjectMatcher[];
matchers?: string[];
/** @deprecated use `object_matchers` */
match?: Record<string, string>;
/** @deprecated use `object_matchers` */
match_re?: Record<string, string>;
group_wait?: string;
group_interval?: string;