title: Collectd multiple instances of write_graphite
body: <p>Does <code>collectd</code> properly support multiple instances of <code>write_graphite</code> plugin? Collectd manpage seems to suggest this in an example: <a href="https://collectd.org/documentation/manpages/collectd.conf.5.shtml#built_in_targets" rel="nofollow">https://collectd.org/documentation/manpages/collectd.conf.5.shtml#built_in_targets</a></p>
  
  <p>I am trying to configure <code>chains</code> specifically, <code>PostCacheChain</code> and send metrics via multiple instances of <code>write_graphite</code> plugin in collectd. The reason is, different metrics need different prefix. </p>
  
  <p>I am unable to get both instances to send data to graphite, only one or the other works.</p>
  
  <p>Using, <code>netstat</code> I can see two sockets established from my collectd host to graphite host. Running <code>tcpdump</code> shows SYN-ACK for both connections, but only one instance sends the data. Metrics that are supposed to be sent via 2nd instance doesn't show up on tcpdump or graphite.</p>
  
  <p>The configuration for <code>write_graphite</code> look like this:</p>
  
  <pre><code>LoadPlugin "write_graphite"
  &lt;Plugin "write_graphite"&gt;
    &lt;Node "def_prefix"&gt;
      Host "metrics.example.com"
      Port "2003"
      Prefix "collectd."
      LogSendErrors true
      Protocol "TCP"
      StoreRates true
      AlwaysAppendDS true
      SeparateInstances true
    &lt;/Node&gt;
    &lt;Node "statsd_prefix"&gt;
      Host "metrics.example.com"
      Port "2003"
      Prefix "statsd."
      LogSendErrors true
      Protocol "TCP"
      StoreRates true
      AlwaysAppendDS true
      SeparateInstances true
    &lt;/Node&gt;
  &lt;/Plugin&gt;
  </code></pre>
  
  <p>And for <code>PostCacheChain</code>:</p>
  
  <pre><code>LoadPlugin match_regex
  PostCacheChain "PostCache"
  &lt;Chain "PostCache"&gt;
    &lt;Rule "statsd_prefix"&gt; # metrics from statsd plugin use diff prefix
      &lt;Match "regex"&gt;
        Plugin "^statsd$"
      &lt;/Match&gt;
      &lt;Target "write"&gt;
        Plugin "write_graphite/statsd_prefix"
      &lt;/Target&gt;
      &lt;Target "return"&gt;
      &lt;/Target&gt;
    &lt;/Rule&gt;
    &lt;Target "write"&gt;
      Plugin "write_graphite/def_prefix"
    &lt;/Target&gt;
  &lt;/Chain&gt;
  </code></pre>
  
  <p>Thanks for any help.</p>