(require 'capacitor.core)
(require 'capacitor.async)
(require 'clojure.core.async)
(require '[riemann.influxdb :as influxdb])
(defn make-async-influxdb-client [opts]
(let [client (influxdb/influxdb opts)
events-in (capacitor.async/make-chan)
resp-out (capacitor.async/make-chan)]
;; Start the run loop with a batch size of max 100 events and max 10
;; seconds
(capacitor.async/run! events-in resp-out client 100 10000)
(fn [series payload]
(let [p (merge payload {
:series series
:time (* 1000 (:time payload)) ;; s → ms
:value (:value payload)
})]
(clojure.core.async/put! events-in p)
(info (format "Sending %s" (str p)))
)
)
)
)
(def influx (make-async-influxdb-client {
:host "inxlux-extra.env"
:port 8086
:version :0.9
:username "x"
:password "x"
:db "devel_metrics"
}))
At first, before upgrade influxdb 0.9, upgraded riemann to 0.2.10 because I readed all change logs and blogs about this: influxdb 0.9 protocol changed!! But, 0.2.10 riemann version still doesn't support 0.9 influxdb api?? In the changelog says YES. Or need make patch over my 0.2.10 riemann version???
I do something wrong into my riemann configuration using influxdb client, I think. But at the past, using a Influx 0.8 with capacitor async client and works, and now, doesn't needs and change to combine batch with influxdb new functions.
Still researching for my error on my riemann.config...
Any ideas?
Thanks for advance
(def influxBatchSender
(batch 100 1/10
(async-queue! :agg {:queue-size 1000
:core-pool-size 1
:max-pool-size 4
:keep-alive-time 60000}
(influxdb {:host "localhost"
:version :0.9
:port "8086"
:db "riemann"
:username "root"
:password "root"}))))