# Add a sql server performance counter

**URL:** <https://community.influxdata.com/t/add-a-sql-server-performance-counter/26330>\
**Category:** Telegraf\
**Created:** [August 30, 2022, 10:11am UTC](https://community.influxdata.com/t/add-a-sql-server-performance-counter/26330 "2022-08-30T10:11:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaMouette](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mamouette/32/10866_2.png) [@MaMouette](https://community.influxdata.com/u/MaMouette)\
**Post date:** [August 30, 2022, 10:11am UTC](https://community.influxdata.com/t/add-a-sql-server-performance-counter/26330/1 "2022-08-30T10:11:54Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Giovanni\_Luisotto](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/giovanni_luisotto/32/4017_2.png) [@Giovanni\_Luisotto](https://community.influxdata.com/u/Giovanni_Luisotto)\
**Post date:** [August 30, 2022, 3:42pm UTC](https://community.influxdata.com/t/add-a-sql-server-performance-counter/26330/2 "2022-08-30T15:42:44Z")

</div>

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

```auto
[[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.

---

<div class="post-metadata">

**Author:** ![MaMouette](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/mamouette/32/10866_2.png) [@MaMouette](https://community.influxdata.com/u/MaMouette)\
**Post date:** [August 30, 2022, 4:40pm UTC](https://community.influxdata.com/t/add-a-sql-server-performance-counter/26330/3 "2022-08-30T16:40:18Z")

</div>

Hi,

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

Thank you for the help 😊.
