aboutsummaryrefslogtreecommitdiff
path: root/node_exporter.go
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2017-09-19 15:54:06 +0100
committerBen Kochie <superq@gmail.com>2017-09-19 07:54:06 -0700
commit3762191e66e309106e930ab11f9c080fb4428001 (patch)
tree6b27445f6c9c92151a2684f1cc4498e6a22e6b35 /node_exporter.go
parentc169b4b1c5108f8e56c9680e7f7b592accdc0dbd (diff)
downloadprometheus_node_collector-3762191e66e309106e930ab11f9c080fb4428001.tar.bz2
prometheus_node_collector-3762191e66e309106e930ab11f9c080fb4428001.tar.xz
prometheus_node_collector-3762191e66e309106e930ab11f9c080fb4428001.zip
Add timex collector (#664)
This collector is based on adjtimex(2) system call. The collector returns three values, status if time is synchronised, offset to remote reference, and local clock frequency adjustment. Values are taken from kernel time keeping data structures to avoid getting involved how the synchronisation is implemented. By that I mean one should not care if time is update using ntpd, systemd.timesyncd, ptpd, and so on. Since all time sync implementation will always end up telling to kernel what is the status with time one can simply omit the software in between, and look results of the syncing. As a positive side effect this makes collector very quick and conceptually specific, this does not monitor availability of NTP server, or network in between, or dns resolution, and other unrelated but necessary things. Minimum set of values to keep eye on are the following three: The node_timex_sync_status tells if local clock is in sync with a remote clock. Value is set to zero when synchronisation to a reliable server is lost, or a time sync software is misconfigured. The node_timex_offset_seconds tells how much local clock is off when compared to reference. In case of multiple time references this value is outcome of RFC 5905 adjustment algorithm. Ideally offset should be close to zero, and it depends about use case how large value is acceptable. For example a typical web server is probably fine if offset is about 0.1 or less, but that would not be good enough for mobile phone base station operator. The node_timex_freq tells amount of adjustment to local clock tick frequency. For example if offset is one second and growing the local clock will need instruction to tick quicker. Number value itself is not very important, and occasional small adjustments are fine. When frequency is unusually in stable one can assume quality of time stamps will not be accurate to very far in sub second range. Obviously explaining why local clock frequency behaves like a passenger in roller coaster is different matter. Explanations can vary from system load, to environmental issues such as a machine being physically too hot. Rest of the measurements can help when debugging. If you run a clock server do probably want to collect and keep track of everything. Pull-request: https://github.com/prometheus/node_exporter/pull/664
Diffstat (limited to 'node_exporter.go')
-rw-r--r--node_exporter.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/node_exporter.go b/node_exporter.go
index e00d6ef..43facf6 100644
--- a/node_exporter.go
+++ b/node_exporter.go
@@ -31,7 +31,7 @@ import (
31) 31)
32 32
33const ( 33const (
34 defaultCollectors = "arp,bcache,conntrack,cpu,diskstats,entropy,edac,exec,filefd,filesystem,hwmon,infiniband,ipvs,loadavg,mdadm,meminfo,netdev,netstat,sockstat,stat,textfile,time,uname,vmstat,wifi,xfs,zfs" 34 defaultCollectors = "arp,bcache,conntrack,cpu,diskstats,entropy,edac,exec,filefd,filesystem,hwmon,infiniband,ipvs,loadavg,mdadm,meminfo,netdev,netstat,sockstat,stat,textfile,time,timex,uname,vmstat,wifi,xfs,zfs"
35) 35)
36 36
37var ( 37var (