Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_perf_counters.tags not being applied #3225

Closed
nheath opened this issue Sep 13, 2017 · 2 comments
Closed

win_perf_counters.tags not being applied #3225

nheath opened this issue Sep 13, 2017 · 2 comments

Comments

@nheath
Copy link

nheath commented Sep 13, 2017

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
Copy link
Author

nheath commented Sep 13, 2017

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 nheath closed this as completed Sep 13, 2017
@tjratch
Copy link

tjratch commented Sep 7, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants