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

Wrong boot time in lxc containers #2968

Closed
ser-evegenii opened this issue Jun 26, 2017 · 6 comments
Closed

Wrong boot time in lxc containers #2968

ser-evegenii opened this issue Jun 26, 2017 · 6 comments
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes

Comments

@ser-evegenii
Copy link

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

@danielnelson
Copy link
Contributor

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

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Jun 26, 2017
@ser-evegenii
Copy link
Author

ser-evegenii commented Jun 26, 2017

shirou/gopsutil#390

@danielnelson danielnelson added the upstream bug or issues that rely on dependency fixes label Aug 9, 2017
@danielnelson
Copy link
Contributor

This may have been fixed for a period, but doesn't seem to be working with LXC 3.
shirou/gopsutil#679

@jessingrass
Copy link
Contributor

seems shirou/gopsutil#894 addresses the upstream issue.

@zeus86
Copy link

zeus86 commented Oct 18, 2021

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?

$ telegraf --version
Telegraf 1.20.2 (git: HEAD f721f53d)

@Astaoth
Copy link

Astaoth commented Apr 30, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior upstream bug or issues that rely on dependency fixes
Projects
None yet
Development

No branches or pull requests

5 participants