beats icon indicating copy to clipboard operation
beats copied to clipboard

[metricbeat] [system] add NTP metricset

Open tommyers-elastic opened this issue 6 months ago • 3 comments

Proposed commit message

Add new Network Time Protocol (NTP) metricset to the system integration.

This is a simple wrapper around an SNTP client which allows monitoring of system clock offset compared to the configured NTP server.

Screenshot 2025-06-17 at 17 14 11

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

tommyers-elastic avatar Jun 17 '25 16:06 tommyers-elastic

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

github-actions[bot] avatar Jun 17 '25 16:06 github-actions[bot]

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @tommyers-elastic? 🙏. For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

mergify[bot] avatar Jun 17 '25 16:06 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b system/ntp upstream/system/ntp
git merge upstream/main
git push upstream system/ntp

mergify[bot] avatar Jun 24 '25 12:06 mergify[bot]

Pinging @elastic/integrations (Team:Integrations)

elasticmachine avatar Jul 09 '25 16:07 elasticmachine

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar Jul 09 '25 17:07 elasticmachine

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b system/ntp upstream/system/ntp
git merge upstream/main
git push upstream system/ntp

mergify[bot] avatar Jul 11 '25 14:07 mergify[bot]

@AndersonQ the hosts config should not be prefixed

metricbeat.modules:
  - module: system
    period: 1s
    metricsets: ["ntp"]
    hosts: ["0.pool.ntp.org", "1.pool.ntp.org"]

i'll update this - because i see now that if you configured multiple metricsets here it errors out (see output below if you also configure cpu). the NTP config needs to be namespaced.

Exiting: host parsing failed for system-cpu: hosts must be empty for system

tommyers-elastic avatar Jul 14 '25 08:07 tommyers-elastic

@AndersonQ the hosts config should not be prefixed

metricbeat.modules:
  - module: system
    period: 1s
    metricsets: ["ntp"]
    hosts: ["0.pool.ntp.org", "1.pool.ntp.org"]

i'll update this - because i see now that if you configured multiple metricsets here it errors out (see output below if you also configure cpu). the NTP config needs to be namespaced.

Exiting: host parsing failed for system-cpu: hosts must be empty for system

ok, let me know when it's ready for re-review

AndersonQ avatar Jul 14 '25 08:07 AndersonQ

@AndersonQ we should be good to go

tommyers-elastic avatar Jul 14 '25 09:07 tommyers-elastic