0
votes

I have multiple input telegraf input plugins for every application and they are separated by the app.toml files. output plugin for all of them is configured in the global telegraf.conf file to write to InfluxDB

Now I am trying to introduce new app but write it's metrics to local filesystem and everything else continue to write to influxDB.

Now when I have my new app with the below configuration, the output file /tmp/metrics.out is collecting all the metrics from other apps as well.

[[inputs.app]]
    context = "/jolokia/read"
    servers = [":7090"]
    metrics =  ["/jvm_heap_usage"]

[[outputs.file]]
  ## Files to write to, "stdout" is a specially handled file.
  files = ["/tmp/metrics.out"]

How can I send all the metrics to InfluxDB and only one app where I added outputs.file to send to local filesystem?

1

1 Answers

2
votes

This can be achieved by using the namepass option on the output plugin.

[[outputs.file]]
  files = ["stdout", "./metrics.out"]
  data_format = "influx"
  namepass = ["mem"]
[[inputs.mem]]
  # No configuration options

The name of the input plugin can also be modified using name_override, name_prefix, or name_suffix.

[[outputs.file]]
  files = ["stdout", "./metrics.out"]
  data_format = "influx"
  namepass = ["app1"]
[[inputs.mem]]
  name_override = "app1"