Hi Guys,

With reading the info from official 
website https://github.com/prometheus/node_exporter/blob/master/docs/TIME.md, 
here comes 2 questions about the metrics.

1. I want to check if my servers are synchronized with NTP server or not. 
>From the source code https://github.com/beevik/ntp/blob/master/ntp.go#L504, 
for my understanding, node_ntp_offset compares local system clock with NTP 
server. But from the following definition "ntp.org always sets NTPD time to 
local clock instead of relaying remote NTP time, so this offset is 
irrelevant for this NTPD.", I'm a little confuse whether this metrics can 
be used or not.

node_ntp_offset

Clock offset 
<https://en.wikipedia.org/wiki/Network_Time_Protocol#Clock_synchronization_algorithm>
 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. 


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/48c393ba-21b7-4378-b1d0-47b7b22caa57n%40googlegroups.com.

Reply via email to