influxdata / influxdata/telegraf

inputs.sqlserver consumes near double CPU on SQL Server 2025

Open
#18,391 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
17.8k
Forks
5.8k
Avg merge
1d 20h
Merged PRs (30d)
161

Description

### Relevant telegraf.conf

```toml
[[inputs.sqlserver]]
servers = [
"Server=server-01;Port=1433;User Id=monitoring;Password=123;app name=telegraf;log=1;",
]
database_type = "SQLServer"
exclude_query = ["SQLServerVolumeSpace","SQLServerAvailabilityReplicaStates", "SQLServerDatabaseReplicaStates", "SQLServerRecentBackups"]
```

### Logs from Telegraf

```text
no warnings or errors observed
```

### System info

Telegraf 1.37.1 (git: HEAD@3352c0d5) @ ubuntu 22.04

### Docker

We've noticed that as soon as we upgraded servers running SQL Server 2022 Enterprise to 2025 Enterprise, the CPU jumped considerably during telegraf collection.
During collection, a 6 CPU VM (Intel Xeon Gold) is showing 40% usage spike. We have multiple servers, and they are all displaying this behavior, graphs showing CPU starting to spike right after the upgrade and during the collection. The same thing happens on idle servers as well; stopping the collection removes the CPU usage, remote or local collection makes no difference. Excluding various queries makes no dramatic difference, it goes down proportionally, we can't pinpoint single query category making all the impact.

### Steps to reproduce

1.Install/Configure inputs.sqlserver
2.Start collection on SQL Server 2025
3. Observe CPU usage during collection using perfmon

### Expected behavior

CPU usage to be similar or the same to SQL Server 2022

### Actual behavior

CPU usage is almost double between 2022 and 2025

### Additional info

On the screenshot, it is visible where the upgrade happened, CPU summation per hour jumped from ~3000 to ~5700

Image

When zooming, it is visible that CPU jumps exactly at collection times:

Image

Stopping the collection removes the CPU usage:

Image

Contributor guide

Open the contributing guide

Research direction

Start with the inputs.sqlserver configuration shown in the issue and reproduce collection against SQL Server 2025 while monitoring CPU with perfmon. Compare collection behavior with SQL Server 2022 and with individual query categories excluded. Done means identifying the collection-related cause of the CPU increase and restoring CPU usage comparable to SQL Server 2022.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
databases, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.