diff --git a/riemann.config b/riemann.config index 94859f5..e286217 100644 --- a/riemann.config +++ b/riemann.config @@ -27,6 +27,58 @@ (expired (fn [event] (info "expired" event)))))))) +; ------------------------------------------------------------------------------ +; STREAM ADDITIONS +(defn add-stream-by [service-name f suffix] + (let [index (index)] + (streams + (where (service service-name) + (coalesce + (smap f + (with {:service (str service-name " " suffix) + :host "Aggregator"} index))))))) + +(defn add-sum-stream [service-name] + (add-stream-by service-name folds/sum "sum")) +(defn add-min-stream [service-name] + (add-stream-by service-name folds/minimum "min")) +(defn add-max-stream [service-name] + (add-stream-by service-name folds/maximum "max")) +(defn add-mean-stream [service-name] + (add-stream-by service-name folds/mean "mean")) +(defn add-median-stream [service-name] + (add-stream-by service-name folds/median "median")) +(defn add-count-stream [service-name] + (add-stream-by service-name folds/count "count")) + + +(defn add-all-grouping-streams [service-name] + (add-sum-stream service-name) + (add-min-stream service-name) + (add-max-stream service-name) + (add-mean-stream service-name) + (add-median-stream service-name) + (add-count-stream service-name)) + +;; This will create a service "supercell prod facebook nb sum" +;; That will contain the sum on all host of the service supercell prod facebook nb +(add-sum-stream "supercell prod facebook nb") +;; This will create all groups for a selected service +;; Meaning sum, min, max, mean, median and count +; (add-all-grouping-streams "supercellvagrant facebook nb") + + +(add-sum-stream "supercell prod nb") +(add-max-stream "supercell prod latency") +(add-sum-stream "haarp nb") +(add-max-stream "supercell prod facebook latency") + +(add-sum-stream "lightning prod public nb") +(add-max-stream "lightning prod public total") +(add-mean-stream "lightning prod public total") +(add-median-stream "lightning prod public total") + +; ------------------------------------------------------------------------------ ;; -- ALERTING (def notify-sysadmin-team (let [email (mailer {:from "riemann@vigiglobe.com"})]