Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
(streams
(changed-state {:init "ok"}
(email "[email protected]")))
(where (tagged "collectd") (not (:ds_type event "gauge"))
#(info %)
)
Conclusion
If your development workflow is sane, then you will already understand that Docker is unnecessary. All of the features which it claims to be helpful are either useless or poorly implemented, and it's primary benefits can be easily achieved using namespaces directly. Docker would have been a cute idea 8 years ago, but it's pretty much useless today.
(def default-services
[{:service #"^load/load/(.*)$" :rewrite "load $1"}
{:service #"^swap/swap_(.*)-(.*)$" :rewrite "swap $1 $2"}
{:service #"^memory/memory-(.*)$" :rewrite "mem $1"}
{:service #"^processes/ps_state-(.*)$" :rewrite "processes $1"}
{:service #"^aggregation-cpu-average/cpu-(.*)$" :rewrite "cpu $1"}
{:service #"^df-(.*)/df_complex-(.*)$" :rewrite "df $1 $2"}
{:service #"^interface-(.*)/if_(errors|packets|octets)/(tx|rx)$" :rewrite "nic $1 $3 $2"}])
(where (tagged "collectd")
(adjust [:service str/replace #"^load/load/(.*)$" "load $1"]
graph
))
Metrics:
app1-web.load/load/shortterm
app1-web.load/load/midterm
app1-web.load/load/longterm
(include "/etc/riemann/mycorp/process.clj"
(ns mycorp.queue
"Instrumentation and alerts for our distributed queue and consumers"
(:require [riemann.config :refer :all]
[riemann.streams :refer :all]
[mycorp.process :refer :all]))
(defn capacity [index pagerduty] ...)
Interval 10
CheckThresholds true
LoadPlugin syslog
LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin processes
(ns examplecom.email
"Riemann email alerting"
(:require [riemann.common :refer :all]
[riemann.core :refer :all]
[riemann.email :refer :all])
)
(def header "Monitoring alert from Riemann\n\n")
(def footer "This is an automated Riemann notification. Please do not reply.")
(ns examplecom.email
"Riemann email alerting"
(:require [riemann.email :refer :all]
[riemann.common :refer :all]
[clojure.string :as str]
[clojure.pprint :as pp])
)
(def header "Monitoring alert from Riemann\n\n")
(def footer "This is an automated Riemann notification. Please do not reply.")