telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

win_perf_counters.tags not being applied

Open nheath opened this issue 9 years ago • 2 comments

win_perf_counter tags are not applied. With the awaited release of 1.4 and fix of #1137 and #2535, I attempted to create two inputs for win_perf_counters with separate tags. I've included a commented out version of this test, but ran into issues getting any tags to send at all.

Relevant telegraf.conf:

[agent]
  interval = "10s"
  round_interval = true
  metric_buffer_limit = 5000
  flush_buffer_when_full = true
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  debug = true
  quiet = false
  logfile = "/logs/telegraf.log"
  hostname = ""

[[outputs.influxdb]]
  urls = ["http://influxdb-server:8086"]
  database = "test"
  precision = "s"
  timeout = "5s"

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

# [[inputs.win_perf_counters]]
#   [[inputs.win_perf_counters.tags]]
#     test = "bar"
#   [[inputs.win_perf_counters.object]]
#     ObjectName = "Processor"
#     Measurement = "Processor"
#     Counters = [
#       "% Interrupt Time",
#       "% Privileged Time",
#       "% Processor Time",
#       "% User Time",
#     ]
#     Instances = ["*"]

System info:

Windows 10, telegraf 1.4 running as a windows service

Expected behavior:

tags applied to collected metrics

Actual behavior:

C:\Program Files\telegraf [master]> .\telegraf.exe -config .\telegraf.conf -test -debug
* Plugin: inputs.win_perf_counters, Collection 1
> Processor,objectname=System,host=nheath-10 Context_Switches_persec=39501.43359375 1505322694000000000
> Processor,objectname=System,host=nheath-10 Processor_Queue_Length=0 1505322694000000000
> Processor,objectname=System,host=nheath-10 System_Calls_persec=226620.765625 1505322694000000000
> Processor,objectname=System,host=nheath-10 Threads=2937 1505322694000000000

nheath avatar Sep 13 '17 17:09 nheath

nevermind, i should have done more testing, i see the correct syntax is [inputs.win_perf_counters.tags] not [[inputs.win_perf_counters.tags]]

nheath avatar Sep 13 '17 17:09 nheath

@nheath I've been starting at my telegraf.conf forever wondering what's wrong. lol Thank you for point out the single braces!

tjratch avatar Sep 07 '18 18:09 tjratch