[collectd] tunneling statsd through collectd then splitting off to graphite via filters

Collectd Person collectd-question at mailinator.com
Tue Oct 1 09:29:37 CEST 2013


Hi all.

I'm using collectd 5.4 on lucid and trying out the statsd and graphite plugins.

My intention was to replace standalone statsd instances on clients with the 
collectd statsd plugin, then have the collectd server log all non-statsd data locally 
via rrdcached, whilst using the write_graphite plugin to forward all statsd traffic 
off to a separate graphite server.

When I configure no filters and have both the rrdcached and write_graphite plugins 
configured, all data goes to both destinations as expected.

On the server:

/etc/collectd/collectd.d/rrdcached.conf:
LoadPlugin "rrdcached"

<Plugin "rrdcached">
  DaemonAddress "unix:/var/run/rrdcached.sock"
  DataDir "/var/lib/collectd/rrd"
  CreateFiles true
  CreateFilesAsync false
</Plugin>


/etc/collectd/collectd.d/write_graphite.conf:
LoadPlugin "write_graphite"

<Plugin "write_graphite">
  <Carbon>
    Host "graphite.mydomain.com"
    Port "2003"
    Prefix "collectd."
    Postfix "."
    Protocol "tcp"
    EscapeCharacter "_"
    SeparateInstances true
    StoreRates true
    AlwaysAppendDS false
  </Carbon>
</Plugin>


On the client:

/etc/collectd/collectd.d/statsd.conf:
LoadPlugin "statsd"

<Plugin "statsd">
  Host "127.0.0.1"
  Port "8125"
  DeleteSets     true
  TimerPercentile 90.0
</Plugin>


When adding the following included by collectd.conf after the above files
/etc/collectd/filters.conf:
PreCacheChain "PreCache"
PostCacheChain "PostCache"

LoadPlugin match_regex

<Chain "PreCache">
</Chain>

<Chain "PostCache">
  # send all `statsd' values to the write_graphite plugin
  <Rule "statsd">
    <Match "regex">
      Plugin "^statsd$"
    </Match>
    <Target "write">
      Plugin "write_graphite"
    </Target>
    Target "stop"
  </Rule>
  <Target "write">
    Plugin "rrdcached"
  </Target>
</Chain>

(This config is based on the mysql example from 
http://www.collectd.org/documentation/manpages/collectd.conf.5.shtml#filter_confi
guration)

I get nothing being sent to the graphite server, whilst the rrdcached data seems 
to come through for the most part. I see the following in the logs:

Filter subsystem: Built-in target `write': Dispatching value to the `rrdcached' 
plugin failed with status -1.
Filter subsystem: Built-in target `write': Dispatching value to the `write_graphite' 
plugin failed with status 2.

I'm not concerned with the rrdcached errors at the moment, only the 
write_graphite failure.

Initially I wanted to put the write_graphite forwarding in the PreCache chain, but 
the docs suggest that only the PostCache chain has access to the write plugins.

Any pointers on where I'm going wrong would be appreciated.

Stumped.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20131001/1a535b28/attachment-0001.html>


More information about the collectd mailing list