influxdata / influxdata/telegraf
Feature request - blkio support for cgroup plugin
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Proposal:
The cgroup plugin should deal with blkio files.
### Current behavior:
The entire file is skipped.
Message: `blkio.io_merged: unknown file format`
#### Configuration:
`[[inputs.cgroup]]`
` paths = [`
` "/sys/fs/cgroup/blkio/machine.slice/machine-*"`
` ]`
` files = [`
` "blkio.io_merged",`
` "blkio.io_queued",`
` "blkio.io_serviced",`
` "blkio.io_service_bytes",`
` "blkio.io_wait_time"`
` ]`
#### Typical file content:
`$ cat blkio.io_wait_time`
`254:5 Read 539663582`
`254:5 Write 0`
`254:5 Sync 0`
`254:5 Async 539663582`
`254:5 Total 539663582`
`Total 539663582`
### Desired behavior:
The cgroup plugin should detect that the file's format differs from the expected ones. Two behaviors can be written :
- Only process the last line beginning by Total
- Map the first column to the physical device
### Use case:
Getting metrics from multipathed devices can be very complex (their name in /dev can change after each reboot according to the SCSI scan). This is why it is easier to get the aggregated data from cgroups. This abstract layer gives directly the metrics linked to a scope (LXC container, VM…).
Contributor guide
Research direction
Start in the cgroup plugin's file-format parsing for blkio.io_wait_time and compare it with the sample lines. Resolve whether the accepted behavior should use the final Total line or map the first column to a physical device; done means configured blkio files are processed instead of skipped and the resulting metrics match that choice.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- observability, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100