Skip to content

Instantly share code, notes, and snippets.

@armiiller
Created October 31, 2019 18:58
Show Gist options
  • Save armiiller/486a65274f9059f09e4a5854e1256cd7 to your computer and use it in GitHub Desktop.
Save armiiller/486a65274f9059f09e4a5854e1256cd7 to your computer and use it in GitHub Desktop.
...
// will look at windows of data so you are not spammed by every datapoint
|window()
.period(period)
.every(period)
...
// send the alert to PagerTree with different levels. Only report state changes.
|alert()
.info(lambda: "value" > info)
.warn(lambda: "value" > warn)
.crit(lambda: "value" > crit)
.stateChangesOnly() // *very important*
.message('{{.ID}} is {{.Level}} value: {{ index .Fields "value" }}')
.id('high_cpu')
.idTag('alertID')
.levelTag('level')
.messageField('message')
.post(pagertree_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment