Last active
October 16, 2019 08:05
-
-
Save XANi/8569698 to your computer and use it in GitHub Desktop.
riemann collectd derive/counter -> rate
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
; Expire old events from the index every 5 seconds. | |
(periodically-expire 600) | |
(def graph (graphite {:host "127.0.0.1"})) | |
; Keep events in the index for 5 minutes by default. | |
(let [index (default :ttl 300 (update-index (index)))] | |
; Inbound events will be passed to these streams: | |
(streams | |
; Index all events immediately. | |
index | |
(where (= (:ds_type event) "derive") | |
(by [:host :service] | |
(ddt 30 (over -0.0000001 graph)) | |
)) | |
(where (= (:ds_type event) "counter") | |
(by [:host :service] | |
(ddt 30 (over -0.0000001 graph)) | |
)) | |
(where (= (:ds_type event) "gauge") | |
(by [:host :service] | |
graph | |
)) | |
; (where (service #"^cpu") | |
; #(info %) | |
; ) | |
; Log expired events. | |
(expired | |
(fn [event] (info "expired" event))) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment