influxdata / influxdata/telegraf

[inputs.systemd_units] Filter for multiple unittypes at the same time

Open
#16,301 0 comments 1 reaction 0 assignees View on GitHub
feature request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.