SuperQ/chrony_exporter

Serverstats don't work on Chrony 4.5

Closed this issue · 7 comments

Am I doing something wrong?

Debug logging shows:

ts=2024-06-12T12:23:23.546Z caller=collector.go:183 level=debug scrape_id=2 msg="Couldn't get serverstats" err="not implemented reply type 25 from &{Version:6 PKTType:reply Res1:0 Res2:0 Command:54 Reply:25 Status:SUCCESS Pad1:0 Pad2:0 Pad3:0 Sequence:2 Pad4:0 Pad5:0}"

Started with:

chrony_exporter --web.config.file=/web-config.yml --web.listen-address=198.51.100.123:9123 --web.listen-address=[2001:db8::123]:9123 --log.level=debug --chrony.address=unix:///run/chrony/chronyd.sock --collector.chmod-socket --collector.sources --collector.serverstats --no-collector.dns-lookups

chronyd (chrony) version 4.5 (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)

on x86_64 Linux.

Probably depends on: facebook/time#363

Also wondering is this should be a debug message or a warning?

level.Debug(logger).Log("msg", "Couldn't get serverstats", "err", err)

Yea, that issue looks related. I wonder if we can expose these packet issues in the exporter.

There is now a pull request: facebook/time#367

I assume some work also needs to be done on the chrony_exporter side?

At a minimum, we will need to update the library version.

Thanks for the work. The errors have changed (which is good, I guess) and no serverstats appear just yet:

ts=2024-06-27T14:06:57.720Z caller=serverstats.go:146 level=debug scrape_id=1 msg="Got 'serverstats' response" serverstats_packet=SUCCESS
ts=2024-06-27T14:06:57.720Z caller=collector.go:183 level=debug scrape_id=1 msg="Couldn't get serverstats" err="got wrong 'serverstats' response: &{{'\\x06' \"reply\" '\\x00' '\\x00' '6' '\\x19' \"SUCCESS\" '\\x00' '\\x00' '\\x00' '\\x02' '\\x00' '\\x00'} {'᧵' '\\x00' 'N' '\\x00' '\\x00' '\\x00' 'É' '\\x00' '\\x00' '\\x03' '\\u0081' '\\x00' '᧵' '᧵' '\\x00' '\\x00' '\\x00'}}"
ts=2024-06-27T14:07:01.794Z caller=serverstats.go:146 level=debug scrape_id=2 msg="Got 'serverstats' response" serverstats_packet=SUCCESS
ts=2024-06-27T14:07:01.794Z caller=collector.go:183 level=debug scrape_id=2 msg="Couldn't get serverstats" err="got wrong 'serverstats' response: &{{'\\x06' \"reply\" '\\x00' '\\x00' '6' '\\x19' \"SUCCESS\" '\\x00' '\\x00' '\\x00' '\\x02' '\\x00' '\\x00'} {'ᨆ' '\\x00' 'S' '\\x00' '\\x00' '\\x00' 'Ë' '\\x00' '\\x00' '\\x03' '\\u0081' '\\x00' 'ᨆ' 'ᨆ' '\\x00' '\\x00' '\\x00'}}"

https://github.com/facebook/time/blob/main/cmd/ntpcheck/checker/chrony.go#L188

chronyd (chrony) version 4.5 (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 -DEBUG)

Still waiting for the pull request to come through.

Adding comment just to add that I"m affected by this and am waiting for the resolution.

It works - thank you!