mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): add feature toggles for alerting functions
This commit is contained in:
parent
9d016a2756
commit
45b2b4bc52
@ -149,6 +149,7 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if setting.AlertingEnabled {
|
||||||
saveAlertCommand := m.SaveAlertsCommand{
|
saveAlertCommand := m.SaveAlertsCommand{
|
||||||
DashboardId: cmd.Result.Id,
|
DashboardId: cmd.Result.Id,
|
||||||
OrgId: c.OrgId,
|
OrgId: c.OrgId,
|
||||||
@ -161,6 +162,7 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) {
|
|||||||
c.JsonApiErr(500, "Failed to save alerts", err)
|
c.JsonApiErr(500, "Failed to save alerts", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
metrics.M_Api_Dashboard_Post.Inc(1)
|
metrics.M_Api_Dashboard_Post.Inc(1)
|
||||||
|
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
package migrations
|
package migrations
|
||||||
|
|
||||||
import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
import (
|
||||||
|
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
|
||||||
|
"github.com/grafana/grafana/pkg/setting"
|
||||||
|
)
|
||||||
|
|
||||||
func addAlertMigrations(mg *Migrator) {
|
func addAlertMigrations(mg *Migrator) {
|
||||||
|
if !setting.AlertingEnabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
alertV1 := Table{
|
alertV1 := Table{
|
||||||
Name: "alert_rule",
|
Name: "alert_rule",
|
||||||
Columns: []*Column{
|
Columns: []*Column{
|
||||||
|
Loading…
Reference in New Issue
Block a user