Skip to content

inputs.disk missing a disk in docker #10422

@JoshKeegan

Description

@JoshKeegan

Relevent telegraf.conf

# Read metrics about disk usage by mount point
[[inputs.disk]]
  ## By default stats will be gathered for all mount points.
  ## Set mount_points will restrict the stats to only the specified mount points.
  # mount_points = ["/"]

  ## Ignore mount points by filesystem type.
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

Logs from Telegraf

2022-01-11T09:35:46Z I! Starting Telegraf 1.21.2
2022-01-11T09:35:46Z I! Using config file: /etc/telegraf/telegraf.conf
2022-01-11T09:35:46Z I! Loaded inputs: cpu disk diskio docker http kernel mem ping processes sensors smart swap system teamspeak
2022-01-11T09:35:46Z I! Loaded aggregators:
2022-01-11T09:35:46Z I! Loaded processors:
2022-01-11T09:35:46Z I! Loaded outputs: influxdb
2022-01-11T09:35:46Z I! Tags enabled:
2022-01-11T09:35:46Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"", Flush Interval:10s

System info

Telegraf v1.12.2 (latest)

Docker

docker-compose.yaml extract:

telegraf:
    build: ./images/telegraf
    privileged: true
    volumes:
      - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
      - /proc:/host/proc:ro
      # Mount the HDD so it can access it for stats
      - /home/josh/data:/disks/hdd:ro
      # utmp from host required for system n_users count
      - /var/run/utmp:/var/run/utmp:ro
      - /dev:/dev:ro
      - /var/run/docker.sock:/var/run/docker.sock
    user: telegraf:${DOCKER_GID}
    environment:
      - HOST_PROC=/host/proc
    networks:
      - influxdb
    restart: unless-stopped

Steps to reproduce

  1. Have a system with multiple drives
  2. Run telegraf in docker with inputs.disk set up, mounting in any additional disks (in my case that is /home/josh/data => /disks/hdd)
    ...

Expected behavior

Disk visible in container (can docker exec into it & use df to check this). Disk should also be being picked up by the telegraf disk input and stats recorded.

Actual behavior

Disk visible in container (can docker exec into it & use df to check this). Disk is not being picked up by the telegraf disk input.
e.g. here is a partition usage graph using the data from telegraf and the disk dissapears after telegraf is upgraded from 1.20.x => 1.21.x:
image

Additional info

Same config was working in telegraf 1.20.x but the disk goes missing after upgrading to 1.21.x. I originally thought it could be related to #10297 but I see that is fixed in the last release and I still have the issue. I've downgraded to v1.20.4 for now as a workaround.

Metadata

Metadata

Assignees

Labels

area/systembugunexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions