Alerting: Support for simplified notification settings in rule API (#81011)
* Add notification settings to storage\domain and API models. Settings are a slice to workaround XORM mapping * Support validation of notification settings when rules are updated * Implement route generator for Alertmanager configuration. That fetches all notification settings. * Update multi-tenant Alertmanager to run the generator before applying the configuration. * Add notification settings labels to state calculation * update the Multi-tenant Alertmanager to provide validation for notification settings * update GET API so only admins can see auto-gen
This commit is contained in:
@@ -77,5 +77,14 @@ resource "grafana_rule_group" "rule_group_0000" {
|
||||
no_data_state = "NoData"
|
||||
exec_err_state = "Alerting"
|
||||
is_paused = false
|
||||
|
||||
notification_settings {
|
||||
receiver = "Test-Receiver"
|
||||
group_by = ["alertname", "grafana_folder", "test"]
|
||||
group_wait = "1s"
|
||||
group_interval = "5s"
|
||||
repeat_interval = "5m"
|
||||
mute_time_intervals = ["test-mute"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,15 @@
|
||||
"noDataState": "NoData",
|
||||
"execErrState": "Alerting",
|
||||
"for": "0s",
|
||||
"isPaused": false
|
||||
"isPaused": false,
|
||||
"notification_settings":{
|
||||
"receiver":"Test-Receiver",
|
||||
"group_by":["alertname","grafana_folder","test"],
|
||||
"group_wait":"1s",
|
||||
"group_interval":"5s",
|
||||
"repeat_interval":"5m",
|
||||
"mute_time_intervals":["test-mute"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -83,3 +83,14 @@ groups:
|
||||
execErrState: Alerting
|
||||
for: 0s
|
||||
isPaused: false
|
||||
notification_settings:
|
||||
receiver: Test-Receiver
|
||||
group_by:
|
||||
- alertname
|
||||
- grafana_folder
|
||||
- test
|
||||
group_wait: 1s
|
||||
group_interval: 5s
|
||||
repeat_interval: 5m
|
||||
mute_time_intervals:
|
||||
- test-mute
|
||||
|
||||
@@ -109,7 +109,15 @@
|
||||
}
|
||||
],
|
||||
"no_data_state": "NoData",
|
||||
"exec_err_state": "Alerting"
|
||||
"exec_err_state": "Alerting",
|
||||
"notification_settings":{
|
||||
"receiver":"Test-Receiver",
|
||||
"group_by":["alertname","grafana_folder","test"],
|
||||
"group_wait":"1s",
|
||||
"group_interval":"5s",
|
||||
"repeat_interval":"5m",
|
||||
"mute_time_intervals":["test-mute"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user