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
Interval 10
CheckThresholds true
LoadPlugin syslog
LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin processes
(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] ...)
(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
(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"}])
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.
(where (tagged "collectd") (not (:ds_type event "gauge"))
#(info %)
)
(streams
(changed-state {:init "ok"}
(email "[email protected]")))
@jamtur01
jamtur01 / gist:7929fc1757be2020764e
Created February 27, 2015 19:25
add Jekyll headers to top of markdown files
perl -pi -e '$.=0 if eof;print "---\nlayout: default\n---\n\n" if ($.==1)' *.md
[cache]
STORAGE_DIR = /var/lib/graphite/
CONF_DIR = /etc/carbon/
LOG_DIR = /var/log/carbon/
PID_DIR = /var/run/
LOCAL_DATA_DIR = /var/lib/graphite/whisper/
USER = _graphite
MAX_CACHE_SIZE = inf
MAX_UPDATES_PER_SECOND = 500
MAX_CREATES_PER_MINUTE = 50