Clock offset between local time and NTPD time.
ntp.org always sets NTPD time to local clock instead of relaying remote NTP time, so this offset is irrelevant for this NTPD.
This value is used in sanity check as part of causality violation estimate.
2. What the usage of node_ntp_sanity?
From the definition
node_ntp_sanity
Aggregate NTPD health including stratum, leap flag, sane freshness, root distance being less than collector.ntp.max-distance and causality violation being less than collector.ntp.local-offset-tolerance.
Causality violation is lower bound estimate of clock error done using SNTP, it's calculated as positive portion of abs(node_ntp_offset) - node_ntp_rtt / 2.
From the source code I found this comment in front of the source code of sanity check. So this metrics is to measure which situation?
"// Here is SNTP packet sanity check that is exposed to move burden of
// configuration from node_exporter user to the developer."
From the lines of code https://github.com/prometheus/node_exporter/blob/master/collector/ntp.go#L169, I think node_ntp_sanity is checking resp.Validate(), resp.RootDistance <= *ntpMaxDistance and resp.MinError <= maxerr, if all the 3 conditions are met, then sanity check reponse 1, which means, the current situation is ok.
Clock offset between local time and NTPD time.
ntp.org always sets NTPD time to local clock instead of relaying remote NTP time, so this offset is irrelevant for this NTPD.
This value is used in sanity check as part of causality violation estimate.
From source code https://github.com/beevik/ntp/blob/master/ntp.go#L504
func offset(org, rec, xmt, dst ntpTime) time.Duration {
// local clock offset
// offset = ((rec-org) + (xmt-dst)) / 2
a := rec.Time().Sub(org.Time())
b := xmt.Time().Sub(dst.Time())
return (a + b) / time.Duration(2)
}
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/48c393ba-21b7-4378-b1d0-47b7b22caa57n%40googlegroups.com.