You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to run this script but no alert is getting created on alerta and logs are not showing any error as well, can anyone help me with this ?
avg_time_gap = sum(current_time - previous_time)/count(num_of_entries)
current_time_gap = (current_value-previous_value)
thresh = abs(current_time_gap-avg_time_gap)
alert when thresh > 0
var window = 20s
var every = 5s // defines the frequency at which the window is emitted to the next node in the pipeline.
var timeout = 360s // alert expiry time
var avg_time = batch
|query('select 20.0/count(content) as avg_time_gap from mydb..measurement')
.period(window)
.every(every)
//numerator must be as same as the window value
var adjacent_time_gap = batch
|query('select difference(content) as time_gap from mydb..measurement')
.period(window)
.every(every)
var data = avg_time
|join(adjacent_time_gap)
.as('avg_time','actual_time')
.tolerance(1s)
|eval(lambda: abs("avg_time.avg_time_gap"-"actual_time.time_gap"))
.as('time_delay')
var alert = data
|alert()
.id(event_name)
.crit(lambda: "time_delay" > 0)
The text was updated successfully, but these errors were encountered:
I have been trying to run this script but no alert is getting created on alerta and logs are not showing any error as well, can anyone help me with this ?
avg_time_gap = sum(current_time - previous_time)/count(num_of_entries)
current_time_gap = (current_value-previous_value)
thresh = abs(current_time_gap-avg_time_gap)
alert when thresh > 0
The text was updated successfully, but these errors were encountered: