host-metrics: bind-mount /dev for inputs.diskio

`inputs.diskio` enumerates devices from /proc/diskstats and then opens
/dev/<name> for udev/uevent lookups. The container's /dev only has
docker's minimal set, so telegraf logs an "error reading /dev/<name>"
warning per device per collection cycle. Mount the host's /dev
read-only so device lookups succeed.
pull/753/head
Prathamesh Musale 2026-05-11 12:07:37 +00:00
parent 6726d68100
commit b7b6bcf731
1 changed files with 5 additions and 0 deletions

View File

@ -21,3 +21,8 @@ services:
- /proc:/hostfs/proc:ro - /proc:/hostfs/proc:ro
- /sys:/hostfs/sys:ro - /sys:/hostfs/sys:ro
- /:/hostfs:ro - /:/hostfs:ro
# /dev is needed by inputs.diskio: it enumerates devices from
# /proc/diskstats and then opens /dev/<name> for udev/uevent lookups.
# Without this mount telegraf logs an "error reading /dev/<name>" warning
# per device per collection cycle.
- /dev:/dev:ro