Telegraf: Memory leak when using Telegraf 1.15. to monitor Azure SQL databases

Created on 25 Aug 2020  路  3Comments  路  Source: influxdata/telegraf

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.

Relevant telegraf.conf:

[[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

System info:

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

Docker

Steps to reproduce:

  1. Confugure the telegraf.conf to get performance counters from Azure SQL
  2. Start the agent

Expected behavior:

Gather performance counters from Azure SQL

Actual behavior:

The telegraf process eventually takes all available memory, the whole system performance slowes down, until the process is restarted, and memory is released.

Additional info:

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.

aresqlserver bug

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.

All 3 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yn1v picture yn1v  路  3Comments

fahimeh2010 picture fahimeh2010  路  3Comments

Bregor picture Bregor  路  3Comments

mabushey picture mabushey  路  3Comments

m4ce picture m4ce  路  3Comments