Skip to content

sqlserver failing with database_type: AzureSQLManagedInstance #8330

@biohazardxxx

Description

@biohazardxxx

Relevant telegraf.conf:

[[inputs.sqlserver]]
  ## Specify instances to monitor with a list of connection strings.
  ## All connection parameters are optional.
  ## By default, the host is localhost, listening on default port, TCP 1433.
  ##   for Windows, the user is the currently running AD user (SSO).
  ##   See https://github.com/denisenkom/go-mssqldb for detailed connection
  ##   parameters.
  servers = [
    "Server=myInstance.123456789.database.windows.net;Port=1433;User Id=telegraf;Password=MySecretPW;app name=telegraf;log=1;",	
   ]

  ## This enables a specific set of queries depending on the database type. If specified, it replaces azuredb = true/false and query_version = 2
  ## In the config file, the sql server plugin section should be repeated  each with a set of servers for a specific database_type.
  ## Possible values for database_type are  
  ## "AzureSQLDB" 
  ## "SQLServer"
  ## "AzureSQLManagedInstance"
  database_type = "AzureSQLManagedInstance"
  
  ## Optional parameter, setting this to 2 will use a new version
  ## of the collection queries that break compatibility with the original
  ## dashboards.
  query_version = 2

  ## If you are using AzureDB, setting this to true will gather resource utilization metrics
  # azuredb = true

  ## If you would like to exclude some of the metrics queries, list them here
  ## Possible choices:
  ## - PerformanceCounters
  ## - WaitStatsCategorized
  ## - DatabaseIO
  ## - DatabaseProperties
  ## - CPUHistory
  ## - DatabaseSize
  ## - DatabaseStats
  ## - MemoryClerk
  ## - VolumeSpace
  # exclude_query = [ 'DatabaseIO' ]

System info:

Azure SQL manage instance
telegraf-1.16.0_windows_amd64

Steps to reproduce:

  1. set database_type = "AzureSQLManagedInstance"
  2. start telegraf

Expected behavior:

No error

Actual behavior:

Error and no metrics are gathered.

Additional info:

2020-10-28T10:22:27Z I! Loaded inputs: sqlserver
2020-10-28T10:22:27Z I! Loaded aggregators: 
2020-10-28T10:22:27Z I! Loaded processors: 
2020-10-28T10:22:27Z I! Loaded outputs: influxdb
2020-10-28T10:22:27Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"HOST", Flush Interval:10s
2020-10-28T10:22:30Z I! [inputs.sqlserver] Config: database_type: AzureSQLManagedInstance , query_version:2 , azuredb: false
2020-10-28T10:22:30Z I! [inputs.sqlserver] Config: Effective Queries: []string{"AzureSQLMIResourceGovernance", "AzureSQLMIDatabaseIO", "AzureSQLMIServerProperties", "AzureSQLMIOsWaitstats", "AzureSQLMISchedulers", "AzureSQLMIResourceStats", "AzureSQLMIMemoryClerks", "AzureSQLMIPerformanceCounters", "AzureSQLMIRequests"}
2020-10-28T10:22:30Z E! [inputs.sqlserver] Error in plugin: sql: expected 30 destination arguments in Scan, not 29
2020-10-28T10:22:30Z I! Incorrect syntax near 'SQL'.
2020-10-28T10:22:30Z I! Incorrect syntax near 'amount'.
2020-10-28T10:22:30Z I! Incorrect syntax near 'Time'.
2020-10-28T10:22:30Z I! Incorrect syntax near ','.
2020-10-28T10:22:30Z E! [inputs.sqlserver] Error in plugin: Script AzureSQLMIPerformanceCounters failed: mssql: Incorrect syntax near ','.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions