Last active
December 20, 2015 08:59
-
-
Save dangerousbeans/6104573 to your computer and use it in GitHub Desktop.
Riemann Config of Greatness
This file contains hidden or 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
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init :file "/var/log/riemann/riemann.log") | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "0.0.0.0"] | |
(tcp-server :host host) | |
(udp-server :host host) | |
(ws-server :host host)) | |
(def email (mailer {:from "[email protected]"})) | |
(def critical-email | |
(email "[email protected]" "[email protected]")) | |
(def tell-ops | |
(throttle 1000 3600 | |
(rollup 2 3600 critical-email))) | |
(let [my-index (index) | |
index (update-index my-index)] | |
(periodically-expire 10) | |
(streams | |
; Anything that's an exception, email everyone right away | |
(where (state "error") critical-email index) | |
; If tagged 'report', we should create a warning if the metric is above a certain threashold | |
(where (tagged "report") | |
; make sure classify API calls are happening faster then 1.5 seconds | |
(where (service "classify latency") | |
(where (<= 0.0 metric 1.5) | |
(with :state "ok" index) | |
(else | |
(with :state "warning" tell-ops index))) | |
(else | |
; regular data with a metric | |
(where (<= 0.0 metric 0.8) | |
(with :state "ok" index) | |
(else | |
(with :state "warning" tell-ops index)))))) ; report | |
(changed-state {:init "ok"} | |
prn | |
; critical-email | |
) | |
; prn | |
index | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment