After upgrading to Telegraf 1.15.2, I have noticed significant memory usage of Telegraf process on Ubuntu Linux
which is configured to monitor performance of SQL Server Azure database, Standard tier.
[[inputs.sqlserver]]
servers = ["Server=*;Port=;User Id=@;Password=*;database=DATABASE_NAME1;app name=telegraf;connection timeout = 5"
,"Server=;Port=;User Id=@;Password=**;database=DATABASE_NAME2;app name=telegraf;connection timeout = 5"]
query_version = 2
azuredb = true
Telegraf 1.15.2
Linux * 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Gather performance counters from Azure SQL
The telegraf process eventually takes all available memory, the whole system performance slowes down, until the process is restarted, and memory is released.
The following error appear massively in syslog:
Aug 25 13:08:00 ** telegraf[8881]: 2020-08-25T13:08:00Z E! [inputs.sqlserver] Error in plugin: mssql: 'TRY_CONVERT' is not a recognized built-in function name.
You could try switching to query_version = 1 or disable the PerformanceCounters query for the time being. If Azure doesn't support TRY_CONVERT, this plugin will need a query update.
cc @Trovalo @denzilribeiro
@grafanaUser123 - When you say Azure SQL are you taking about Single database? TRY_CONVERT is valid on Azure SQL . YOu can copy/paste the query defined in the file https://github.com/influxdata/telegraf/blob/master/plugins/inputs/sqlserver/sqlserver.go ( constant defined is const sqlPerformanceCountersV2 string ) and execute it in SSMS or a query window.. works fine for me... BTW in latest pr added etter diagnostics to output what collector is actually failing.
@grafanaUser123 any update on this one?
Most helpful comment
@grafanaUser123 - When you say Azure SQL are you taking about Single database? TRY_CONVERT is valid on Azure SQL . YOu can copy/paste the query defined in the file https://github.com/influxdata/telegraf/blob/master/plugins/inputs/sqlserver/sqlserver.go ( constant defined is const sqlPerformanceCountersV2 string ) and execute it in SSMS or a query window.. works fine for me... BTW in latest pr added etter diagnostics to output what collector is actually failing.