Ntpd-rs supports exporting key operational metrics to an external prometheus instance.
Installed from package
If ntpd-rs was installed from the packages distributed by us, the default configuration will already have enabled the observation socket. Furthermore, these packages contain a systemd unit file that enables the metrics exporter with a reasonable configuration. This can be enabled with
After enabling the metrics exporter, a prometheus metrics dataset will be served on
Installed through cargo or from source
When installed through cargo or from source, two things need to be configured manually:
- Enable the observability socket in the ntpd-rs configuration.
- Configure the system to run ntp-metrics-exporter as a service.
The observability socket can be enabled by adding the following to the configuration:
Next, configure your system to run the ntp-metrics-exporter binary as a service. For systemd based systems, an example is provided below.
Description=Network Time Service (ntpd-rs) metrics exporter