influxdata / influxdata/telegraf
Windows Performance Counters Errors after adding 'User Input Delay per Session'.
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Relevant telegraf.conf
```toml
[[inputs.win_perf_counters.object]]
Measurement = "win_mem"
ObjectName = "Memory"
# ## Use 6 x - to remove the Instance bit from the counterPath.
Instances = ["------"]
Counters = [
"Available Bytes",
"Cache Faults/sec",
"Demand Zero Faults/sec",
"Page Faults/sec",
"Pages/sec",
"Transition Faults/sec",
"Pool Nonpaged Bytes",
"Pool Paged Bytes",
"Standby Cache Reserve Bytes",
"Standby Cache Normal Priority Bytes",
"Standby Cache Core Bytes",
]
#
# ## Example query where the Instance portion must be removed to get data back,
# ## such as from the Paging File object.
[[inputs.win_perf_counters.object]]
Measurement = "win_swap"
ObjectName = "Paging File"
Instances = ["_Total"]
Counters = [
"% Usage",
]
[[inputs.win_perf_counters.object]]
Measurement = "win_user_input"
ObjectName = "User Input Delay per Session"
Instances = ["*"]
Counters = [
"Max Input Delay",
]
```
### Logs from Telegraf
```text
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Available Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Cache Faults/sec", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Demand Zero Faults/sec", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Page Faults/sec", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Pages/sec", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Transition Faults/sec", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Pool Nonpaged Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Pool Paged Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Standby Cache Reserve Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Standby Cache Normal Priority Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Memory\\Standby Cache Core Bytes", instance: ------, will skip metric: The data is not valid.
2024-11-13T12:01:40Z W! [inputs.win_perf_counters] Error while getting value for counter "\\Paging File(_Total)\\% Usage", instance: _Total, will skip metric: The data is not valid.
```
### System info
Telegraf 1.32.2, Windows 10 21H2 64-bit
### Docker
_No response_
### Steps to reproduce
1. enable windows perfomance counters objects in config.
2. add this section to config:
[[inputs.win_perf_counters.object]]
Measurement = "win_user_input"
ObjectName = "User Input Delay per Session"
Instances = ["*"]
Counters = [
"Max Input Delay",
]
2. run Telegraf as administrator
### Expected behavior
No errors
### Actual behavior
Errors while getting values for memory and Paging File counters. LogicalDisk counters not written.
### Additional info
After writing the bug report, I found that the errors disappear when Telegraf is run unprivileged. However, I decided to submit the issue anyway in case it might be helpful.
Thanks!
Contributor guide
Research direction
Start at the win_perf_counters input and reproduce the supplied configuration on Windows 10, comparing administrator and unprivileged runs. Trace the User Input Delay per Session setup and the reported Memory, Paging File, and LogicalDisk errors; done means the configured counters collect without errors when run as administrator.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100