influxdata / influxdata/telegraf
[inputs.systemd_units] Filter for multiple unittypes at the same time
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Use Case
I want to use systemd_units to monitor both services AND sockets.
### Expected behavior
I can use the `unittype` filter to add multiple types to it. For example: `unittype = "service, socket"`
### Actual behavior
Currently only one type is accepted at the `unittype`
### Additional info
I am maybe wrong and don't know Go enough, but it seems to me that only 1 unittype is accepted here:
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/systemd_units/systemd_units_linux.go#L151
Contributor guide
Research direction
Start in plugins/inputs/systemd_units/systemd_units_linux.go at the referenced handling around line 151, and trace how the unittype filter is parsed and applied. Add support for selecting both service and socket units, then verify that both types are monitored as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100