At this time, the Datadog sqlserver check only queries data from the sys.dm_os_performance_counters table, although you can use WMI to expose metrics from other counter tables. To collect specific data, find counter_name and, when applicable, instance_name to correspond to the metric you’re interested in collecting. Once you access your server from powershell’s sqlcmd, run the following or similar query to get a list of what count_names are available in that table in your SQL Server.
Note: This returns a long list.
1> SELECT counter_name, instance_name, cntr_value, cntr_type FROM sys.dm_os_performance_counters;
2> go
From there you can pick out the counter_names that are most interesting to you, add them to your custom metric section of the sqlserver.yaml in the “counter_name” options, and give your metric an appropriate name in the “- name:” options (you may want to start them with “sqlserver.” like all the other sqlserver metrics).
An example of what your sqlserver.d/conf.yaml might look like if you wanted to collect metrics for the CLR Execution, Queued requests, and Active requests properties is as follows: