Skip to content

Instantly share code, notes, and snippets.

@regel
Created December 9, 2018 21:16
Show Gist options
  • Save regel/917533a566ebc2d8989c3d5d2f935235 to your computer and use it in GitHub Desktop.
Save regel/917533a566ebc2d8989c3d5d2f935235 to your computer and use it in GitHub Desktop.
TICK script section triggering alerts to PagerDuty
var pos = data
|changeDetect('is_anomaly')
|alert()
.warn(lambda: "is_anomaly" == TRUE)
.crit(lambda: "is_anomaly" == TRUE AND "score" > 90.0)
.message('{{if ne .Level "OK" }} Hey, unexpected situation detected score={{ index .Fields "score" | printf "%0.3f" }} {{else}} Back to normal {{end}}')
.pagerDuty2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment