-
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
Wrong boot time in lxc containers #2968
Comments
Can you raise this with the gopsutil project and link to the issue? Here is the function that is called for uptime: https://github.com/shirou/gopsutil/blob/master/host/host_linux.go#L93 |
This may have been fixed for a period, but doesn't seem to be working with LXC 3. |
seems shirou/gopsutil#894 addresses the upstream issue. |
As far as i can tell - even if this issue is addressed upstream - if does not have any effect onto telegraf yet. LXC Containers still report the uptime of their hypervisor, instead of their own; at least on pxoxmox 6 and 7 (ubuntu focal guests, x86_64), where I tested this, so this should be repoenend. maybe a switch in the config-section from where to read the uptime would be suitable?
|
Hi, I can confirm than Telegraf in a LXC on Proxmox 7 doesn't report the right uptime (Telegraf 1.22, VM and Proxmox up-to-date). The idea of @zeus86 seems fine, would it be possible to add this switch ? |
Telegraf system input plugin use btime in /proc/stat to count uptime. This behavior a little wrong, because in lxc containers btime show boot hoster time, but not container.
Maybe better get uptime metric in /proc/uptime
The text was updated successfully, but these errors were encountered: