Skip to content

Commit 0de10db

Browse files
authored
updates to alert related objects (#112)
1 parent 3f6b799 commit 0de10db

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

model.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,15 +475,11 @@ func Roleingestor(stream string) string {
475475

476476
func getTargetBody() string {
477477
return ` {
478-
"name":"targetName",
478+
"name":"targetName",
479479
"type": "webhook",
480480
"endpoint": "https://webhook.site/ec627445-d52b-44e9-948d-56671df3581e",
481481
"headers": {},
482-
"skipTlsCheck": true,
483-
"repeat": {
484-
"interval": "1m",
485-
"times": 1
486-
}
482+
"skipTlsCheck": true
487483
}
488484
`
489485
}
@@ -513,13 +509,23 @@ func getAlertBody(stream string, targetId string) string {
513509
"operator": "=",
514510
"value": 100
515511
},
512+
"anomalyConfig": {
513+
"historicDuration": "1d"
514+
},
515+
"forecastConfig": {
516+
"historicDuration": "1d",
517+
"forecastDuration": "3h"
518+
},
516519
"evalConfig": {
517520
"rollingWindow": {
518521
"evalStart": "5m",
519522
"evalEnd": "now",
520523
"evalFrequency": 1
521524
}
522525
},
526+
"notificationConfig": {
527+
"interval": 1
528+
},
523529
"targets": [
524530
"%s"
525531
],
@@ -562,7 +568,8 @@ func createAlertResponse(id string, state string, created string, datasets []str
562568
"tags": [
563569
"quest-test"
564570
],
565-
"datasets": %s
571+
"datasets": %s,
572+
"notificationState": "notify"
566573
}
567574
]`, created, id, state, string(datasetsJSON))
568575
}

0 commit comments

Comments
 (0)