Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bhuvanabalraj opened this issue Mar 14, 2024 · 0 comments

Comments

@bhuvanabalraj
Copy link

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')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant