From eec510607940f7bb0fbdc75972b1b19857f0a98a Mon Sep 17 00:00:00 2001 From: anant Date: Tue, 12 Aug 2025 18:42:59 +0530 Subject: [PATCH] updates to alert related objects --- model.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/model.go b/model.go index ff35fb3..387a322 100644 --- a/model.go +++ b/model.go @@ -475,15 +475,11 @@ func Roleingestor(stream string) string { func getTargetBody() string { return ` { - "name":"targetName", + "name":"targetName", "type": "webhook", "endpoint": "https://webhook.site/ec627445-d52b-44e9-948d-56671df3581e", "headers": {}, - "skipTlsCheck": true, - "repeat": { - "interval": "1m", - "times": 1 - } + "skipTlsCheck": true } ` } @@ -513,6 +509,13 @@ func getAlertBody(stream string, targetId string) string { "operator": "=", "value": 100 }, + "anomalyConfig": { + "historicDuration": "1d" + }, + "forecastConfig": { + "historicDuration": "1d", + "forecastDuration": "3h" + }, "evalConfig": { "rollingWindow": { "evalStart": "5m", @@ -520,6 +523,9 @@ func getAlertBody(stream string, targetId string) string { "evalFrequency": 1 } }, + "notificationConfig": { + "interval": 1 + }, "targets": [ "%s" ], @@ -562,7 +568,8 @@ func createAlertResponse(id string, state string, created string, datasets []str "tags": [ "quest-test" ], - "datasets": %s + "datasets": %s, + "notificationState": "notify" } ]`, created, id, state, string(datasetsJSON)) }