We upgraded kapacitor to 1.3.0~beta2, and tried to use stateDuration to alert when the event last more than 3 minutes.
when expression evaluated as false, the stat duration value was -1, and when evaluated true, it changed to 0, but didnot increase anymore, just stay as 0
Is this the right node to use? and how should i use it? thanks.
var response_data = stream
|from()
.database(‘test’)
.measurement(measurement)
.groupBy(‘domain’,‘monitor_name’)
|window()
.period(1m)
.every(1m)
.align()
response_data
|stateDuration(lambda: int(“result_status”) != 1 )
.unit(1m)
.as(‘resultstatus_events_duration’)
|httpOut(‘resultstatus_events_duration’)
|alert()
.crit(lambda: “resultstatus_events_duration” > 3 )
.alerta()
.message(‘http result error’ + string(arp))
.event(’ {{ index .Tags “domain” }} http result error’)
.resource(resource)