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

Escaping # in metric instance name in telegraf.conf #1546

Closed
Aleyho opened this issue Jul 25, 2016 · 7 comments
Closed

Escaping # in metric instance name in telegraf.conf #1546

Aleyho opened this issue Jul 25, 2016 · 7 comments

Comments

@Aleyho
Copy link

Aleyho commented Jul 25, 2016

Bug report

Relevant telegraf.conf:

System info: Windows Server 2012, Telegraf 1.0.0-beta3

Steps to reproduce:

While calling a inputs.win_perf_counters.object, Object type process, I'm running into a problem with having an instance name with a # as part of the instance. On a particular server I have two of the same processes running but I only need to monitor the 2nd. As I label the instance "process#1" for example naturally it comments out the rest of the line. If I attempt to escape it with "process#1" this also breaks the entire process and no results from telegraf are collected.

Expected behavior:

\ should escape the # and allow "process#1" as an instance name for a process

Actual behavior:

"process#1" as an instance name causes Telegraf to relay no data

Additional info:

[[inputs.win_perf_counters.object]]
ObjectName = "Process"
Counters = ["% Privileged Time", "% User Time"]
Instances = ["Ax32Serv#1"]
Measurement = "win_process"

@sparrc
Copy link
Contributor

sparrc commented Jul 26, 2016

what happens if you double-escape it?

[[inputs.win_perf_counters.object]]
ObjectName = "Process"
Counters = ["% Privileged Time", "% User Time"]
Instances = ["Ax32Serv\\#1"]
Measurement = "win_process"

@sparrc
Copy link
Contributor

sparrc commented Jul 26, 2016

or also try it with single quotes, with no escaping:

[[inputs.win_perf_counters.object]]
  ObjectName = "Process"
  Counters = ["% Privileged Time", "% User Time"]
  Instances = ['Ax32Serv#1']
  Measurement = "win_process"

@Aleyho
Copy link
Author

Aleyho commented Jul 28, 2016

Incidentally those are the first two things I tried, but unfortunately neither worked.

@sparrc
Copy link
Contributor

sparrc commented Jul 28, 2016

that's unfortunate....might be a bug in the toml parsing library we use then 😕, don't really have time now to track it down but any PRs or additional debugging are greatly appreciated.

@Aleyho
Copy link
Author

Aleyho commented Jul 29, 2016

No worries, I'll see what I can do.

@dmitrysdm
Copy link

dmitrysdm commented Aug 11, 2016

I think i have the same problem, follow config doesn't working

  [[inputs.win_perf_counters.object]]
    # Example query where the Instance portion must be removed to get data back, such as from the Memory object.
    ObjectName = "NVIDIA GPU"
    Counters = ["% GPU Usage", "% GPU Memory Usage", "Temperature (ºC)"]
    Instances = ["*"] # Use 6 x - to remove the Instance bit from the query.
    Measurement = "win_nvidia_gpu"
    #IncludeTotal=false #Set to true to include _Total instance when querying for all (*).

maybe this happens because my nvidia card instance also have # in the name!
#0 Quadro 2000 (id=1, NVAPI ID=3840)

@danielnelson
Copy link
Contributor

I believe this has been fixed by #1827.

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

4 participants