Bug 250513 - net-mgmt/telegraf: uptime is reported as seconds-since-epoch, not seconds-since-boot
Summary: net-mgmt/telegraf: uptime is reported as seconds-since-epoch, not seconds-sin...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Palle Girgensohn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-21 18:39 UTC by Ulrich Spörlein
Modified: 2020-10-21 18:39 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (girgen)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Spörlein freebsd_committer 2020-10-21 18:39:38 UTC
So there I was installing telegraf, influxdb, grafana and the like and noticed my uptime measured in about 1 year (which itself is bogus, but not the problem).

The problem is that the gopsutil as used by telegraf has a bug in how it returns uptime on FreeBSD. This is fixed in head, but broken in the 2.19.7 version used by the port.

See this:
% sudo telegraf -config /usr/local/etc/telegraf.conf -test|grep uptime; date +%s
2020-10-21T18:31:37Z I! Starting Telegraf 1.15.3
> system,host=coyote.spoerlein.net uptime=1603305097i 1603305097000000000
> system,host=coyote.spoerlein.net uptime_format="18556 days, 18:31" 1603305097000000000
1603305097

And indeed, checking out 2.19.7 and running a simple print uptime command I get:

% go run gopsutil_uptime.go
1603305234 <nil>

Bisecting shows that v2.20.7 is the first version that fixes it:

% go run gopsutil_uptime.go
1152659 <nil>


Much better. Interestingly, the only commit for that month was a major refactor, that doesn't even state that it fixes this _significant_ problem on FreeBSD.

https://github.com/shirou/gopsutil/commit/28890b0482feb66e057d2e2763d851f020f8dd65

Please approve that I bump the dependency to v2.20.7, thanks.