我尝试使用 Telegraf 收集有关我的 Docker 容器的一些指标。我已经将 docker sock 安装到它上面,但我仍然收到一条错误消息。我在这里想念什么?
volumes:
- ./data/telegraf:/etc/telegraf
- /var/run/docker.sock:/var/run/docker.sock
2021-10-29T20:11:30Z E! [inputs.docker] Error in plugin: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http:///var/run/docker.sock/v1.21/containers/json?filters={"status":["running"]}&limit=0": dial unix /var/run/docker.so
[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
gather_services = false
container_names = []
source_tag = false
container_name_include = []
container_name_exclude = []
timeout = "5s"
perdevice = true
total = false
docker_label_include = []
docker_label_exclude = []
tag_env = ["JAVA_HOME", "HEAP_SIZE"]