Skip to content

Instantly share code, notes, and snippets.

@featheredtoast
Created July 15, 2015 00:29
Show Gist options
  • Save featheredtoast/f5c01bbb5eef7e7d01ee to your computer and use it in GitHub Desktop.
Save featheredtoast/f5c01bbb5eef7e7d01ee to your computer and use it in GitHub Desktop.
riemann receive consul events
(defn consul-service-down-detect []
(by [:host :service]
(where (tagged "consul")
(changed :state {:init "ok"}
(stable 300 :state
#(info %)
(where (not (state "ok"))
(tag "alert" #(info %) index)
(with :metric 1 (graph)))
(where (state "ok")
(with :metric 0
(graph))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment