Win_perf_counters doesn't support multiple instances?

Hey guys,

I wanted to start here before I filed an issue on GitHub. I’ve been toying with deploying Telegraf configs with SaltStack and I’ve split some of the Windows performance counters into separate .conf files, and Telegraf is called with --config-directory flag.

However, after some hair-pulling, it looks like only the last file containing the inputs is actually being shipped to InfluxDB.

For example:

221_inputs_winperf_generic.conf

###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################

[[inputs.win_perf_counters]]
  [[inputs.win_perf_counters.object]]
    Instances = [ "*" ]
    Counters = [ "% Idle Time", "% Disk Time", "% Disk Read Time", "% Disk Write Time", "% User Time", "Current Disk Queue Length", "% Free Space", "Free Megabytes" ]
    ObjectName = "LogicalDisk"
    Measurement = "winperf_logicaldisk"

  [[inputs.win_perf_counters.object]]
    ObjectName = "System"
    Counters = ["Context Switches/sec","System Calls/sec", "Processor Queue Length"]
    Instances = ["------"]
    Measurement = "winperf_system"

  [[inputs.win_perf_counters.object]]
    Instances = [ "*" ]
    Counters = [ "Bytes Received/sec", "Bytes Sent/sec", "Current Bandwidth", "Output Queue Length" ]
    ObjectName = "Network Interface"
    Measurement = "winperf_networkinterface"

  [[inputs.win_perf_counters.object]]
    Instances = [ "*" ]
    Counters = [ "% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time" ]
    ObjectName = "Processor"
    Measurement = "winperf_processor"

  [[inputs.win_perf_counters.object]]
    Instances = [ "------" ]
    Counters = [ "Available Bytes", "Cache Faults/sec", "Demand Zero Faults/sec", "Page Faults/sec", "Pages/sec", "Transition Faults/sec", "Pool Nonpaged Bytes", "Pool Paged Bytes" ]
    ObjectName = "Memory"
    Measurement = "winperf_memory"

222_inputs_winperf_processes.conf

[[inputs.win_perf_counters]]
  [[inputs.win_perf_counters.object]]
    ObjectName = "Process"
    Counters = [
      "% Processor Time",
      "Handle Count",
      "Private Bytes",
      "Thread Count",
      "Virtual Bytes",
      "Working Set"
    ]
    Instances = ["*"]
    Measurement = "winperf_proc"
    #IncludeTotal=false #Set to true to include _Total instance when querying for all (*).

I wanted to be able to split these out into separate [[inputs.win_perf_counters]] sections as I wanted to apply tags for each one (And route to different databases if needed), and I also have some counters that I will only apply to specific hosts (Eg. IIS).

As a temporary workaround, I even tried omitting the [[inputs.win_perf_counters]] header on my second file, hoping that when the conf.d directory is processed, the files are essentially just merged and it would assume the second file is still under this header. However, this doesn’t seem to be working either, so my only option is to merge the configs for now.

I’m currently running Telegraf agent 1.1.0 as when I tried to upgrade recently, it kept failing and this was the last known good binary I had to hand.

This issue was fixed in version 1.4.

Is the issue with win_perf_counters crashing out resolved too? Couldn’t see it in change log but I’ve seen an issue

I’m not sure, we do have a number of known issues for this plugin and I don’t remember a crash fix. If you don’t see an open issue for your problem could you create one?

Looks like all is well with 1.4.1!

Thanks

1 Like