[collectd] Send collectd data with different Graphite prefixes

Steve Wray steve at wtfast.com
Wed Sep 16 00:00:05 CEST 2015

We are gathering both system performance metrics (eg cpu directly from
collectd) as well as application performance metrics (eg an application
sends some of its internal performance metrics to collectd via the statsd

We'd like these to go into graphite with different prefixes eg the system
performance metrics should go under eg server.sys. and application metrics
should go under eg app.statsd.

I've been looking at chains and I'd thought that this should do something
like what we need:

<LoadPlugin cpu>
  Globals false

<LoadPlugin statsd>
  Globals false
<Plugin statsd>
  Host ""
  Port 8125

# This should be the default write, it should get the stats from the cpu

<Plugin write_graphite>
<Node "collectd_graphite">
  Host "our.graphite.server"
  Port "2003"
  # it goes under server.sys.
  Prefix "server.sys."
  Protocol "tcp"

# This should catch writes from statsd and send them to collectd with the
app.statsd. prefix.
# It should not get the cpu stats as that doesn't come via statsd

LoadPlugin "match_regex"
<Chain "PreCache">
    <Match "regex">
      Plugin "^statsd$"
    <Target "write">
      <Plugin "write_graphite">
        <Node "collectd_graphite">
          Host "our.graphite.server"
          Port "2003"
          Prefix "app.statsd."
          EscapeCharacter "."
          Protocol "tcp"
    Target "stop"
   Target "write"

Whats actually happening is that the statsd data is being sent to graphite
with the server.sys. prefix.

Any advice on using Chains would be helpful.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20150915/33b2691c/attachment.html>

More information about the collectd mailing list