Created
November 17, 2015 22:31
-
-
Save agile/3205b661dc650b5ff4ee to your computer and use it in GitHub Desktop.
trying to understand how to fix this.. only initial state change alerts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Wanting to pass events by host/service, if state changed and consistent for `len-run` events | |
; modified changed-state macro to use runs | |
(defmacro stable-changed-state | |
"Passes on changes in state for each distinct host and service." | |
[len-run & children] | |
`(by [:host :service] | |
(runs ~len-run | |
(changed :state ~@children)))) | |
(def send-alert #(debug "WOULD ALERT ON" %)) | |
(streams | |
(where (not= "expired" (:state event)) | |
(splitp re-matches service | |
#".*an.interesting.service" | |
(split | |
; only alerts on the the first state change until riemann restarted.. | |
(> metric 500) (with :state "critical" index graph (stable-changed-state 2 send-alert)) | |
(> metric 250) (with :state "warning" index graph (stable-changed-state 2 send-alert)) | |
(with :state "ok" index graph)) | |
#(debug "unmatched service: " %)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment