[collectd] How to use write_tsdb with metadata?

Joel Carnat joel at carnat.net
Mon Feb 13 11:50:57 CET 2023


Hello,

Reading the PR #1107, it tried to reproduce metadata configuration so 
that my collectd will send tags for instances, types etc to my TSDB 
compatible database (VictoriaMetrics).

But when checking the configuration, I get errors I don't know how to 
solve. As the PR dates from 2015, I expect the syntax to been different, 
but I don't understand how to modify it.

# collectd -T -C /etc/collectd.conf
(...)
[2023-02-13 11:39:46] plugin_load: plugin "swap" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "write_tsdb" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "match_regex" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "target_set" successfully loaded.
[2023-02-13 11:39:46] Target `set': The `MetaDataSet' configuration 
option is not understood and willbe ignored.
[2023-02-13 11:39:46] Target `set': The `MetaDataSet' configuration 
option is not understood and willbe ignored.
[2023-02-13 11:39:46] Target `set': The `MetaDataSet' configuration 
option is not understood and willbe ignored.
[2023-02-13 11:39:46] Target `set': The `MetaDataSet' configuration 
option is not understood and willbe ignored.
[2023-02-13 11:39:46] Target `set': You need to set at least one of 
`Host', `Plugin', `PluginInstance', `TypeInstance', `MetaData', or 
`DeleteMetaData'.
[2023-02-13 11:39:46] Filter subsystem: Failed to create a set target.
[2023-02-13 11:39:46] plugin_load: plugin "uptime" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "processes" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "threshold" successfully loaded.
[2023-02-13 11:39:46] plugin_load: plugin "exec" successfully loaded.
Error: Parsing the config file failed!

My configuration goes like this:
(...)
LoadPlugin "write_tsdb"
LoadPlugin "match_regex"
LoadPlugin "target_set"

<Plugin write_tsdb>
   <Node>
     Host "localhost"
     Port "4242"
     HostTags "os=OpenBSD collector=collectd"
     StoreRates false
     AlwaysAppendDS false
   </Node>
</Plugin>

<Chain "PreCache">
  <Rule "opentsdb_tags">
   <Match "regex">
    Plugin ".*"
   </Match>
   <Target "set">
    MetaDataSet "tsdb_tag_pluginInstance" "instance"
    MetaDataSet "tsdb_tag_type" "type"
    MetaDataSet "tsdb_tag_typeInstance" "type_instance"
    MetaDataSet "tsdb_tag_dsname" "dsname"
   </Target>
  </Rule>
</Chain>

Any ideas how to solve these and/or pointers to configuration examples I 
could study?

Thank you,
Joel C.



More information about the collectd mailing list