[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:

LoadPlugin "rrdcached"

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

LoadPlugin "write_graphite"

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

On the client:

LoadPlugin "statsd"

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

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

LoadPlugin match_regex

<Chain "PreCache">

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

(This config is based on the mysql example from 

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.


-------------- 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