Fluentd CSV to Prometheus

191 views
Skip to first unread message

Frany Chevry

unread,
Jun 29, 2017, 11:16:27 AM6/29/17
to Fluentd Google Group
Hello, 

Could someone please let me know if they have worked with pushing csv files data to prometheus using Fluentd. 

here's an example of my configuration file

<source>
  @type prometheus
</source>

<source>
  @type tail
  format csv
  path /testing/ip.csv
  pos_file /var/spool/td-agent/testing.pos
  tag testing
  keys key1,key2,key3
  time_key key2
  time_format %m/%d/%Y %H:%M:%S
</source>


<match **>
  @type copy
  format json
  <store>
    @type prometheus
    <metric>
      name key1
      type gauge
      desc The total Owner Array Name
      key key1
    </metric>
  </store>
</match>

When I look at the fluentd log, this is what the output looks like
2017-06-29 14:40:37 +0000 [warn]: prometheus: failed to instrument a metric. error_class=ArgumentError error=#<ArgumentError: value must be a number> tag="testing" name="key1"
2017-06-29 14:40:37 +0000 [warn]: dump an error event: error_class=ArgumentError error="value must be a number" tag="testing" time=1498669768 record={ "key1"=>"0.000000"}.....

So based on this configuration with prometheus, it's listening to a specific port, when I go to the port, I do not see any data. I see the name and the type, but no value. Anybody have had to work with this in the past?

Thank you.


Mr. Fiber

unread,
Jun 30, 2017, 2:51:45 AM6/30/17
to Fluentd Google Group
The error said the cause. You need to use number instead of string.


Masahiro

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages