node_ntp_stratum metric is not exposed by node_exporter to verify NTP time synchronization

35 views
Skip to first unread message

Jayaprakash Rangaswamy

unread,
Jul 13, 2020, 11:34:49 AM7/13/20
to Prometheus Users
I'm looking for a metric to verify NTP time synchronization with remote NTP servers located within the organization through node-exporter & Prometheus.

In the below documentation, I see node_ntp_stratum metric is good enough to identify the synchronization against the stratum value. 
https://github.com/prometheus/node_exporter/blob/master/docs/TIME.md#node_ntp_stratum

But I don't see the NTP related metrics available in the list of metrics exposed through node_exporter. 
As per below doc, I tried setting sysctl -w kernel.perf_event_paranoid to 1 but still no luck. 

No NTP metrics listed: 
curl -X GET http://127.0.0.1:19100/metrics | grep -i 'ntp_'



Other Details:

node_exporter Version - 0.17.0

Prometheus Version - 2.10.0




Brian Candler

unread,
Jul 13, 2020, 1:09:11 PM7/13/20
to Prometheus Users
You did notice that these are in the "disabled by default" section of node_exporter, and you have to enable them with a CLI flag? (--collector.ntp)

$ curl -Ss 127.0.0.1:9100/metrics | egrep '^(node_ntp_|# (HELP|TYPE) node_ntp_)'
# HELP node_ntp_leap NTPD leap second indicator, 2 bits.
# TYPE node_ntp_leap gauge
node_ntp_leap 0
# HELP node_ntp_offset_seconds ClockOffset between NTP and local clock.
# TYPE node_ntp_offset_seconds gauge
node_ntp_offset_seconds 1.4906e-05
# HELP node_ntp_reference_timestamp_seconds NTPD ReferenceTime, UNIX timestamp.
# TYPE node_ntp_reference_timestamp_seconds gauge
node_ntp_reference_timestamp_seconds 1.594660007565626e+09
# HELP node_ntp_root_delay_seconds NTPD RootDelay.
# TYPE node_ntp_root_delay_seconds gauge
node_ntp_root_delay_seconds 0.006286621
# HELP node_ntp_root_dispersion_seconds NTPD RootDispersion.
# TYPE node_ntp_root_dispersion_seconds gauge
node_ntp_root_dispersion_seconds 0.00541687
# HELP node_ntp_rtt_seconds RTT to NTPD.
# TYPE node_ntp_rtt_seconds gauge
node_ntp_rtt_seconds 0.0001571
# HELP node_ntp_sanity NTPD sanity according to RFC5905 heuristics and configured limits.
# TYPE node_ntp_sanity gauge
node_ntp_sanity 1
# HELP node_ntp_stratum NTPD stratum.
# TYPE node_ntp_stratum gauge
node_ntp_stratum 2

Jayaprakash Rangaswamy

unread,
Jul 13, 2020, 3:05:10 PM7/13/20
to Prometheus Users
Thanks Brain Candler. It works. 
Reply all
Reply to author
Forward
0 new messages