influxdata / kapacitor

Open source framework for processing, monitoring, and alerting on time series data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to configure the deadman function to trigger a warning alert instead of a critical alert in kapacitor

bhuvanabalraj opened this issue · comments

Goal is to configure the deadman function in Kapacitor to trigger a warning alert instead of a critical alert, when there is no metrics form the measurement , Looks like deadman by default when there is no metrics, it is triggering critical alert. tried to run the script with Level tag and without level tag to trigger only warning when there is no metrics but still no luck. Appreciate some ideas to get this fixed.

var data = stream
|from()
.measurement(measurement)
.where(where_filter)
.groupBy(group_by)
|window()
.period(period)
.every(every)
|default()
.field(field_upper, 0.0)

var nodata = data
|deadman(deadman_threshold, deadman_interval)
.id(id)
.message(message)
.stateChangesOnly()
//.levelTag('level')
//.warn(lambda: "level" == 'CRITICAL')
//.warnReset(lambda: "level" == 'OK'
.warn(lambda: "emitted" <= deadman_threshold)
.warnReset(lambda: "emitted" > deadman_threshold)
.topic(topic) // Comment out .topic to disable alert sending and uncomment .log to write alerts to file
//.log('/tmp/alerts.log')