Skip to content

Conversation

@HappyTobi
Copy link
Contributor

Summary

I created a new input plugin to be able to get / measure the time drifts from a Linux system to the configured ntp server.
The benefit of the plugin is, that we get the metrics from the Linux Kernel directly.
So you will get the time metrics when you are using systemd, chrony or ndpt because all the tools are calling the kernel.

As an background:
The metric can help to detect time drifts in a VM from the configure NTP server.
The metrics can also help to improve / finde issues for example with the current chrony settings because you can see the time drifts and you now have the possibility to understand them better.

Checklist

  • No AI generated code was used in this PR

Related issues

@telegraf-tiger
Copy link
Contributor

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Oct 15, 2025
@HappyTobi
Copy link
Contributor Author

!signed-cla

@srebhan srebhan changed the title feat(inputs.timex): New input plugin to get ntp time from linux kernel feat(inputs.timex): Add plugin Oct 15, 2025
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution @HappyTobi! Please find my comments in the code.

@srebhan srebhan self-assigned this Oct 15, 2025
@HappyTobi HappyTobi requested a review from srebhan October 16, 2025 10:06
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HappyTobi! Some more minor comments...

@HappyTobi HappyTobi requested a review from srebhan October 16, 2025 15:53
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HappyTobi! Just some formatting comments and a question regarding the frequency field left...

@srebhan
Copy link
Member

srebhan commented Oct 24, 2025

Reading more deeply into the matter, freq, ppsfreq and stabil are in 2^-16 ppm i.e. in parts-per-million. One ppm corresponds to 1e-6 or 1/10,000 %. We cannot easily compute the frequency offset in freq as we would need to know the absolute clock frequency.

Furthermore, freq is the frequency offset and not the frequency itself. So please

  1. Make clear the frequency field carries an offset e.g. by naming it frequency_offset.
  2. Keep the fields for the ppm information in ppm i.e. just divide them by 2^16 and adjust the field-unit suffices.

What do you think?

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks @HappyTobi! Some last, really cosmetric, comments from my side...

@HappyTobi HappyTobi requested a review from srebhan October 27, 2025 13:26
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks a lot @HappyTobi for working with me on this PR!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Oct 27, 2025
@srebhan srebhan assigned skartikey and mstrandboge and unassigned srebhan Oct 27, 2025
Copy link
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HappyTobi Thanks! A couple of minor comments.

@HappyTobi HappyTobi requested a review from skartikey October 31, 2025 13:43
@telegraf-tiger
Copy link
Contributor

Copy link
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HappyTobi Thanks for the contribution!

@skartikey skartikey merged commit 50cf281 into influxdata:master Oct 31, 2025
26 of 27 checks passed
@github-actions github-actions bot added this to the v1.37.0 milestone Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin new plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants