Created
January 9, 2014 23:11
-
-
Save chiradeep/8343882 to your computer and use it in GitHub Desktop.
Riemann configuration to generate notifications like CloudWatch Alarms
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
(streams | |
(where (not (expired? event)) | |
;; over time windows of 3 seconds... | |
(fixed-time-window 3 | |
;; calculate the average value of the metric and emit an average (summary) event | |
(combine folds/mean | |
;; if there are no events in the window, we can get nil events | |
(where (not (nil? event)) | |
#(info "average event" %) | |
;; collect the summary event over the last 3 fixed-time-windows | |
(moving-event-window 3 | |
;;find the summary event with the minimum average metric | |
(combine folds/minimum | |
;; see if it breached the threshold | |
(where (> metric 6.0) | |
#(info "[TC]" %) | |
;; send the event in an email | |
(email "itguy@coolwebapp.net")))))) | |
)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment