Posting tags and fields to influxdb from riemann

299 views
Skip to first unread message

mani kandan

unread,
Sep 8, 2015, 8:57:53 PM9/8/15
to Riemann Users
Team,

I used to post events from riemann to influxdb and it was working great. Then use the data from influxdb in grafana dashboard. For better filtering in dashboard, I like to send tags and fields to influxdb from riemann. I am aware that riemann supports it. Any of you tried it and can you please share some examples on how to do it, that will be really very helpful.

I am trying to send something like

series_name,tag1="value",tag2="value" field="value"

Thanks,
-Mani

Tomeu Capó Capó

unread,
Sep 10, 2015, 12:16:07 PM9/10/15
to Riemann Users
Hi Mani,

How send Riemann events to influxdb? I have similar error.

Thanks for advance

mani kandan

unread,
Sep 10, 2015, 1:45:56 PM9/10/15
to rieman...@googlegroups.com
After a little try with influxdb 0.9.x and riemann 0.2.10. I was able to get the event posted to with below config. I just wrote below adhoc to check if it working

; vim: filetype=clojure

(logging/init {:file "riemann.log"})

(require '[riemann.influxdb :as influxdb])


; Listen on the local interface over TCP (5555), UDP (5555), and websockets

; (5556)

(let [host "127.0.0.1"]

  (tcp-server {:host host})

  (udp-server {:host host})

  (ws-server  {:host host}))


; Expire old events from the index every 5 seconds.

(periodically-expire 5)


(streams

  (where (service "MyService")

    (fn[event]

        (let [client (influxdb/influxdb-9 {

                        :username "test"

                        :password "test"

                        :scheme "http"

                        :host "localhost"

                        :port 8086

                        :db "riemann"

                        :tag-fields #{:tagfield}})]

              (client event)))))


And my event look like (posting with riemann client)

 r << {host:"a",service:"MyService",metric:1.0, tagfield:'mine',ttl:30}


Thanks,

-Mani


--
You received this message because you are subscribed to a topic in the Google Groups "Riemann Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/riemann-users/k6O16QN5jb0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to riemann-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
ALWAYS KEEP SMILING

 FOR U EVER,
 
     G.MANIKANDAN

Tomeu Capó Capó

unread,
Sep 10, 2015, 2:09:14 PM9/10/15
to Riemann Users
I tried use same configuration but, riemann throws exception same as:

ClassCastException java.lang.Double cannot be cast to java.lang.CharSequence  clojure.string/escape (string.clj:307)

Send this type of event, for example:

{:host "sa3P9K409HXEX0H", :service "disk /tuie", :state "ok", :description "6% used", :tags ["test"], :time (System/currentTimeMillis), :ttl 10, :metric 0.2}

Don't undersand client's fails ... Sorry

mani kandan

unread,
Sep 10, 2015, 2:48:55 PM9/10/15
to rieman...@googlegroups.com
The event looks pretty simple and I don't have much clue on why it is failing. The only non constant is time. You can try sending event with constant time  and check it. You can also try updating time as (quot (System/currentTimeMillis) 1000) but that does not make any big difference too. You should also check how you are parsing the event at riemann server. 

Thanks,
-Mani

Tomeu Capó Capó

unread,
Sep 11, 2015, 4:20:10 AM9/11/15
to Riemann Users
Seem strange,

I made a test directly with lein repl, you now? This is a console for Clojure, I clone riemann git repository and launch: lein repl. Simple require influxdb client and call without streams or anything, and simply crash with :metric double.
I don't understand.

Thanks
Reply all
Reply to author
Forward
0 new messages