influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.63k stars 5.58k forks source link

Support namespacing plugins #8696

Closed ssoroka closed 11 months ago

ssoroka commented 3 years ago

Feature Request

namespace plugins so that you can easily control the flow of metrics through Telegraf without depending on a rather verbose namepass setup.

eg

# -------------- namespace 1
[inputs.cpu]
  namespace = "foo"
[processors.starlark]
  namespace = "foo"
[outputs.file]
  namespace = "foo"
# -------------- namespace 2
[inputs.cpu]
  namespace = "foo2"
[processors.rename]
  namespace = "foo2"
[outputs.file]
  namespace = "foo2"
# --------------
borpin commented 3 years ago

Would this be the same as multiple instances of one plugin? I want to collect data from several Monit instances, but I can't from the same Telegraf instance.

I see some plugins offer an 'array of hosts' but AFAICS only one user/password for all hosts.

Instead of the namespace how about (for example);

[[inputs.monit.host1]]
# config
[[inputs.monit.host2]]
#config

This would (should) work for any plugin.

cavivie commented 1 year ago

I am also in need of such namepace plugins to complete complex telegraf input and output. On my same machine, I need multiple sets of input/output, and I already know that name filter and tag filter can be used to complete this task, but the use of tag filters and name filters is very ugly and covert. For example, I have multiple input sources where the metric name of the input source may be coupled, and multiple input sources, which makes the filter very difficult to maintain.