Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Berlin 2013 - Riemann Workshop - Pierre-Yves Ri...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Monitorama
September 20, 2013
710
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Berlin 2013 - Riemann Workshop - Pierre-Yves Ritschard
Monitorama
September 20, 2013
More Decks by Monitorama
See All by Monitorama
Monitorama PDX 2017 - Ian Bennett
monitorama
1
630
PDX 2017 - Pedro Andrade
monitorama
0
830
PDX 2017 - Roy Rapoport
monitorama
4
1k
PDX 2017 - Julia Evans
monitorama
0
520
Berlin 2013 - Session - Brad Lhotsky
monitorama
5
770
Berlin 2013 - Session - Alex Petrov
monitorama
6
730
Berlin 2013 - Session - Jeff Weinstein
monitorama
2
670
Berlin 2013 - Session - Oliver Hankeln
monitorama
1
590
Berlin 2013 - Session - David Goodlad
monitorama
0
520
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.1k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.6k
Making Projects Easy
brettharned
120
6.7k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
230
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
750
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
180
Facilitating Awesome Meetings
lara
57
7k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
280
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Transcript
@pyr
https://github.com/pyr
• Riemann concepts • In-app events • System metrics •
Just enough clojure • Common use cases Agenda
Event stream processor • Process • Analyze • React
None
{:host “foo1” :service “cpu %” :metric 50.85 :state “ok” :description
“System CPU gauge”}
Where do events come from • Your app • Collectd
• Riemann-health • Logstash
import bernhard c = bernhard.Client() c.send({‘host’: “appserver”, ‘service’: “sql query
time”, ‘metric’: 200})
require ‘riemann/client’ c = Riemann::Client.new c << {host: “appserver”, service:
“sql query time”, metric: 200}
LoadPlugin write_riemann <Plugin write_riemann> <Node “main”> Host “riemann-host” </Node> </Plugin>
Event lifecycle • Enters riemann • Follows streams • Optionally
indexed
Looking at events • Queries • Dashboard
require ‘riemann/client’ c = Riemann::Client.new c[‘true’] c[‘service = “cpu”’] c[‘tagged
“web-servers”’]
Configuration API Features • Percentiles • EWMA • Fixed /
Moving event windows • Event coalescing • Many more
Configuration • Configuration is code • Code is in clojure
Clojure
Clojure • Functional Lisp • Immutable • Data first, not
objects first • Lazy • Concurrent
Clojure (defn hello [name] (println “hello” name) (def a-map {:some-key
“some value”}) (def an-array [0 1 2 :foo]) (def a-set #{:a :b :c}) (def a-pattern #”^(.*)[ \t]+=(.*)[ \t]+$”) (def inline-fn #(+ 3 %)) (def anon-fn (fn [a b] (+ a b)))
Clojure (defn greeter [greeting] (fn [name] (println greeting “, “
name))) (let [german-greeting (greeter “Hallo”)] (german-greeting “Rich”))
Clojure (let [m {:foo 0 :bar 1} a [3 2
1 0]] (conj a 4) ;; => (4 3 2 1 0) (assoc m :baz 2)) ;; => {:foo 0 :bar 1 :baz 2}
Clojure (ns my-sql-query-ns (:require [clojure.data.jdbc :as jdbc] [clojure.data.jdbc.sql :as sql]))
(jdbc/query mysql-db (sql/select * :users)) ;;=> ({:login “root” :uid 0} {:login :daemon :uid 1})
Clojure (def lotsa-ones (repeat 1)) ;; => lazy-seq (take 5
lotsa-ones) ;; => (1 1 1 1 1) (take 2 (interleave lotsa-ones (repeat 2))) ;; => (1 2)
Clojure (def requests (atom 0)) (swap! requests inc) @request ;;
=> 1 (def user1 (ref 10)) (def user2 (ref 50)) (dosync (alter user1 + 10) (alter user2 - 10)) @user1 ;; => 20 @user2 ;; => 40
Clojure (def users {:alice {:balance 10} :bob {:balance 5}}) (defn
transaction [from to amount] (-> users (update-in [from :balance] - amount) (update-in [to :balance] + amount)))
Index (def index (default {:ttl 60 :state “ok”} (update-index (index))))
Streams (let [index (default {:ttl 60 :state “ok”} (update-index (index)))]
(streams index))
Streams (let [index (default {:ttl 60 :state “ok”} (update-index (index)))
email (mailer {:from “riemann@production”})] (streams index (where (state “critical”) email) ))
Demo!