Skip to content

Export actual system uptime #1895

@pxeger

Description

@pxeger

Host operating system: output of uname -a

Linux <redacted> 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 1.0.1 (branch: tarball, revision: 1.0.1)
  build user:       someone@builder
  build date:       20200616-18:35:17
  go version:       go1.14.4

node_exporter command line flags

None

Are you running node_exporter in Docker?

No

What did you expect to see?

The actual system uptime as reported by the first value in /proc/uptime.

What did you see instead?

Various "hacks" to get to the uptime which are all bad:

  • sum(node_cpu_seconds_total{cpu=0}) - total time the kernel has reported the CPU doing anything, too inaccurate
  • node_boot_time_seconds from /proc/stat's btime, which requires you to get the current time on the server and subtract it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions