mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): add aggregator field
This commit is contained in:
parent
bcf10a6483
commit
769016783f
@ -12,10 +12,11 @@ type Alert struct {
|
|||||||
QueryRefId string
|
QueryRefId string
|
||||||
WarnLevel int64
|
WarnLevel int64
|
||||||
ErrorLevel int64
|
ErrorLevel int64
|
||||||
CheckInterval string
|
Interval string
|
||||||
Title string
|
Title string
|
||||||
Description string
|
Description string
|
||||||
QueryRange string
|
QueryRange string
|
||||||
|
Aggregator string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *SaveDashboardCommand) GetAlertModels() *[]Alert {
|
func (cmd *SaveDashboardCommand) GetAlertModels() *[]Alert {
|
||||||
@ -27,14 +28,15 @@ func (cmd *SaveDashboardCommand) GetAlertModels() *[]Alert {
|
|||||||
DashboardId: dash.Id,
|
DashboardId: dash.Id,
|
||||||
Id: 1,
|
Id: 1,
|
||||||
PanelId: 1,
|
PanelId: 1,
|
||||||
Query: "",
|
Query: "query",
|
||||||
QueryRefId: "",
|
QueryRefId: "query_ref",
|
||||||
WarnLevel: 0,
|
WarnLevel: 0,
|
||||||
ErrorLevel: 0,
|
ErrorLevel: 0,
|
||||||
CheckInterval: "5s",
|
Interval: "5s",
|
||||||
Title: dash.Title + " Alert",
|
Title: dash.Title + " Alert",
|
||||||
Description: dash.Title + " Description",
|
Description: dash.Title + " Description",
|
||||||
QueryRange: "10m",
|
QueryRange: "10m",
|
||||||
|
Aggregator: "avg",
|
||||||
})
|
})
|
||||||
|
|
||||||
return &alerts
|
return &alerts
|
||||||
|
@ -15,10 +15,11 @@ func addAlertMigrations(mg *Migrator) {
|
|||||||
{Name: "query_ref_id", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "query_ref_id", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "warn_level", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "warn_level", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "error_level", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "error_level", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "check_interval", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "interval", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
{Name: "query_range", Type: DB_NVarchar, Length: 255, Nullable: false},
|
{Name: "query_range", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
|
{Name: "aggregator", Type: DB_NVarchar, Length: 255, Nullable: false},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user