-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
procstat can not find pid of process using pattern lookup in dockerized telegraf #6813
Comments
Hi - i'm not sure if this is generally a bug in telegraf. If you use pgrep as finder, it doesn't care about /proc under /rootfs/proc. The native finder seems to supports this. I tried some research and got stuck at here: If i get this right, PidExistsWithContext invokes FindProcess and then proc.Signal. But hey, this process doesn't exists in this namespace/container. After that, error handling does is best and this is silently failing. IMO this is an expected behaviour if you run telegraf in a container. You can even reproduce this with ps and kill in /bin/bash executed in a container:
|
I can confirm that One more problem also is different version of gopsutil stated in Gopkg.lock and Gopkg.toml (known dep issue), checked in master and 1.13.0 tag. In https://github.com/influxdata/telegraf/blob/master/Gopkg.lock:
In https://github.com/influxdata/telegraf/blob/master/Gopkg.toml:
|
@i-prudnikov Thanks for opening the upstream issue, makes sense that these symlinks won't mesh well with the bind mounts and HOST_PROC. @arindamchoudhury It seems as a workaround one could bind mount the binaries you are monitoring into the container. Can you try using
This is setup this way on purpose, to provide more flexibility with what versions can be used. Telegraf can use 2.19.7 or later, but we are compiling with 2.19.11 for the official packages. It's a bit academic but can be useful in practice when the direct dependencies and transitive dependencies both depend on a library. |
Opened a pull request to fix problem with broken symlink |
This comment has been minimized.
This comment has been minimized.
I managed to replicate the original problem, then tried updating to the latest gopsutil. Can confirm the upstream issue resolved as of github.com/shirou/[email protected]. The only potential issue is shirou/gopsutil#842, but I think it's worth updating anyway. |
Hi,
I am using telegraf 1.13.0.
the telegraf.conf
I started the telegraf with the coomand:
It cant find the process. the logs:
The process exists:
in host:
Inside telegraf docker:
If I change to pid_finder = "native", still it can not find it.:
The text was updated successfully, but these errors were encountered: