telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

SqlServer Input: Add sqlserver ProcessID to SQL queries

Open mikedavem opened this issue 5 years ago • 5 comments

Feature Request

Adding SqlServer Process ID to ServerProperties metrics

Proposal:

Adding SERVERPROPERTY('ProcessID') can help for correlation between win_perf_counters metrics and SqlServer Process counters and the corresponding SQL Server instance

Current behavior:

Currently there is no way to correlate CPU usage in interval of seconds

Desired behavior:

Having the ProcessID of the sqlservr process from ServerProperties query V2

Use case:

In a scenario where there is one SQL instance installed on a Windows Server, correlation with Win process counters is easy because there is only one instance of the sqlserver process. However, the current proposal would be helpful for SQL multi-instances scenarios due to multiple instances of the sqlservr process in win_perf_counters making the correlation between Win process counters and the corresponding SQL Instances impossible without the correct Process ID.

mikedavem avatar Feb 24 '20 18:02 mikedavem

I think we can close this feature request because metric is exposed through sqlserver_cpu_sqlserver_process_cpu

Regards

mikedavem avatar Jan 19 '21 15:01 mikedavem

I reopen this issue because after some tests, sqlserver_cpu_sqlserver_process_cpu metric is unfortunately not enough accurate and not enough refreshed over the time to be included for monitoring. For example, if we compare variation in values over the time with SQL Server process:Processor Time% perfmon counter the latter provides more representative values.

Having a query that provides the current SQL Server process ID could make easier correlation with related SQL Server Process Perfmon counters

select SERVERPROPERTY('processid') AS SqlInstanceProcessId

mikedavem avatar Mar 04 '21 09:03 mikedavem

@danielnelson any news on that one ? Any chance to consider this request feature for next plugin version ? Thank you for your feedback :)

dba-leshop avatar Feb 07 '22 18:02 dba-leshop

Hi @reimda , is it something we can consider for next releases ?

Thank you

dba-leshop avatar Dec 19 '22 06:12 dba-leshop

@dba-leshop put up a PR and I am sure we can get folks to review

powersj avatar Jan 04 '23 23:01 powersj