Skip to content

Instantly share code, notes, and snippets.

@benmoss
Created August 13, 2014 16:30
Show Gist options
  • Save benmoss/72ec4c6e16ea995c3df6 to your computer and use it in GitHub Desktop.
Save benmoss/72ec4c6e16ea995c3df6 to your computer and use it in GitHub Desktop.
; -*- mode: clojure; -*-
; vim: filetype=clojure
(logging/init {:file "/var/log/riemann/riemann.log"})
; Listen on the local interface over TCP (5555), UDP (5555), and websockets
; (5556)
(let [host "0.0.0.0"]
(tcp-server {:host host})
(udp-server {:host host})
(ws-server {:host host}))
; Expire old events from the index every 5 seconds.
(periodically-expire 5)
(let [index (index)]
; Inbound events will be passed to these streams:
(streams
(default :ttl 60
#(info "received event" %)
(where (service "clerk_postgres_data")
(with {:metric 1 :service "clerk_postgres_data_agg"} (rate 5 index))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment