If you got this error – [inputs.docker] Error in plugin: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
It’s because /var/run.docker.sock is only accessible by root or anyone in docker group. telegraf is not in this group.
The fix is to add telegraf to docker group: usermod -a -G docker telegraf