Skip to content

[SQL Server Input plugin] Configurable Query Timeout #9377

@bhsu-ms

Description

@bhsu-ms

Feature Request

Introduce configurable timeout for queries in SQL plugin to prevent telegraf queries blocking SQL server resources.

Proposal:

There is no timeout for telegraf queries in SQL server plugin today. Telegraf could potentially trigger long running queries and cause performance issues. Introducing timeouts in queries will prevent long running queries from happening. There could be many reasons why even a simple DMV query gets blocked or executes much slower than expected, so a timeout would be a good thing in general. This timeout is configurable. If no timeout is specified for the connection string, the default timeout will be 30s. Customers can also set the timeout to some value that fits their scenario.

Current behavior:

No timeout for SQL server plugin queries. Telegraf could have long running queries that cause performance issues.

Desired behavior:

  1. If the user does not specify query timeout value, we set the query timeout to 30s.
  2. If the user specifies a different timeout value in telegraf.conf, we use that value as query timeout.

Use case:

Timeout could prevent telegraf from introducing long running queries causing performance issues.

I'm willing to make the change, but wanted to gather feedback before I create a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions