Skip to content
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

Collecting host stats from within docker containers with Telegraf 1.1 #2527

Closed
garceri opened this issue Mar 10, 2017 · 7 comments
Closed

Collecting host stats from within docker containers with Telegraf 1.1 #2527

garceri opened this issue Mar 10, 2017 · 7 comments
Labels
area/docker bug unexpected problem or unintended behavior

Comments

@garceri
Copy link

garceri commented Mar 10, 2017

In version 0.1X of Telegraf the HOST_PROC/HOST_SYS/HOST_ETC environment variables could be used to override the mountpoint location of /sys /proc and /etc filesystem, this allowed collecting host metrics from within a docker container.Looks like this is no longer supported on 1.1
From looking at the /plugins/inputs/system/processes.go file i can see that the /proc location is hardcoded.
Would it be possible to enable a configuration option for the input plugins to allow specifying the alternate mountpoint ?
Something like:

sysfs_mount = /rootfs/sys
procfs_mount = /rootfs/proc

@danielnelson
Copy link
Contributor

I believe this functionality is provided by gopsutil so it should work. If it is not, can you provide the plugin you are using, the base image you are experiencing the problem in, and any other relevant information so it can be duplicated.

https://github.com/shirou/gopsutil#usage

@garceri
Copy link
Author

garceri commented Mar 10, 2017

Yep, the issue seems to be related to the system/process input plugin
if you look at this, you will notice that /proc is hardcoded there, that makes impossible to get host process stats

@danielnelson
Copy link
Contributor

Got it, we can do the proposed change. Maybe named proc_path, sys_path.

@diegito
Copy link

diegito commented Apr 27, 2017

I believe I have a related problem with my docker-telegraf - with net plugin enabled - picking up only the interfaces from within the docker container (i.e. I can see only eth0 interface), and not the interfaces of the system.

@danielnelson danielnelson added this to the 1.4.0 milestone Apr 27, 2017
@danielnelson danielnelson added bug unexpected problem or unintended behavior area/docker labels Apr 27, 2017
MatthewCh pushed a commit to MatthewCh/telegraf that referenced this issue Jun 14, 2017
…rs by enable procfs and sysfs location overrides
@danielnelson
Copy link
Contributor

@diegito Can you open a new issue your net problem?

@danielnelson
Copy link
Contributor

HOST_PROC support has been added for the processes plugin, will be in 1.4. Leaving this issue open to add config file support.

@danielnelson
Copy link
Contributor

I created a new issue #4006 to track the remaining work.

@danielnelson danielnelson removed this from the 1.7.0 milestone Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants