Add a sql server performance counter

Hi,
I am trying to collect some metrics of MS SQL Server. They are in perfmon.
I added the following section in telegraf.conf
I restart the serice and use the -test command. I do not see error, but I do not see the counter. Neither in the datas of influxdb.

[[inputs.win_perf_counters.object]]
ObjectName = “MSSQL$xxxxx:Locks”
Instances = [“_Total”]
Counters = [“Lock Requests/s”]
Measurement = “sql_locks”

Is it normal ?

You are missing a part (or maybe you forgot it) and there might be a TOML escaping-related issue

when using double quotes / must be escaped in strings, meaning it has to be written as //. to avoid it you can use single quotes

[[inputs.win_perf_counters]] <-- this was missing
  [[inputs.win_perf_counters.object]]
  ObjectName = “MSSQL$xxxxx:Locks”
  Instances = [“_Total”]
  Counters = ['Lock Requests/s'] <-- single quotes here
  Measurement = “sql_locks”

Since you are getting it from perfmon it should work.

1 Like

Hi,

You are right on both points. It’s OK now (I’m completely new on Telegraf).

Thank you for the help :blush:.