influxdata / influxdata/telegraf
Feature request: custom arguments to pgrep for procstat
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Proposal:
For advanced use cases, it would be nice to be able to provide custom arguments to the `pgrep` command used by the `procstat` input plugin.
### Current behavior:
No such option
### Desired behavior:
```
[[inputs.procstat]]
pgrep = ["-w","-x","foo"]
```
### Use case: [Why is this important (helps with prioritizing requests)]
In my specific use case, and in the example I gave above, we want `-w` so that we can monitor threads. We also need `-x` so that `pgrep` doesn't erroneously match the wrong process. The `-x` is just a nicety though, and we can match other ways. The important bit which we have no workaround for is the `-w`. But a generic way to provide custom arguments makes it more flexible so users can do whatever they want.
Ref: #1828 #1723 #932
Contributor guide
Research direction
Locate the procstat input plugin and read how it currently builds and runs the pgrep command. Support the proposed pgrep argument configuration, including the example flags, and verify that procstat can monitor matching threads without the previous fixed-argument limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100