Skip to content

feat(inputs.chrony): Add probing #16861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

LandonTClipp
Copy link
Contributor

@LandonTClipp LandonTClipp commented Apr 22, 2025

Summary

This adds the Probe() error method to the inputs.chrony plugin to allow for startup probing as defined in /docs/specs/tsd-009-probe-on-startup.md.

A sanity check was done to ensure this does indeed behave as expected when the chrony daemon is not available:

2025-04-22T17:39:14Z I! [agent] Failed to probe inputs.chrony, shutting down plugin: querying sources failed: read udp 127.0.0.1:53811->127.0.0.1:323: read: connection refused

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16860

Documentation updates related to: #16859

This adds the `Probe() error` method to the `inputs.chrony` plugin to allow
for startup probing as defined in `/docs/specs/tsd-009-probe-on-startup.md`.

A sanity check was done to ensure this does indeed behave as expected when
the chrony daemon is not available:

```
2025-04-22T17:39:14Z I! [agent] Failed to probe inputs.chrony, shutting down plugin: querying sources failed: read udp 127.0.0.1:53811->127.0.0.1:323: read: connection refused
```
@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Apr 22, 2025
@telegraf-tiger
Copy link
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

🥳 This pull request decreases the Telegraf binary size by -3.49 % for linux amd64 (new size: 285.3 MB, nightly size 295.7 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

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 for the PR @LandonTClipp! Two comments in the code...
Additionally, I think your tests should be improved. You should use the model (see e.g. inputs.nvidia_smi) and adapt the server to stop after the initial connect by introducing a new option to it that makes the serve loop exit.

Comment on lines +150 to +153
_, err := c.client.Communicate(sourcesReq)
if err != nil {
return fmt.Errorf("querying sources failed: %w", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, err := c.client.Communicate(sourcesReq)
if err != nil {
return fmt.Errorf("querying sources failed: %w", err)
}
if _, err := c.client.Communicate(sourcesReq); err != nil {
return fmt.Errorf("querying sources failed: %w", err)
}

@srebhan srebhan self-assigned this May 7, 2025
@srebhan srebhan added the plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins label May 7, 2025
@srebhan srebhan changed the title feat(inputs.chrony): Add Probe() error method feat(inputs.chrony): Add probing May 7, 2025
@LandonTClipp
Copy link
Contributor Author

You got it, I'll work on improving the tests.

@srebhan srebhan added the waiting for response waiting for response from contributor label Jun 12, 2025
@telegraf-tiger
Copy link
Contributor

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Forums or provide additional details in this issue and reqeust that it be re-opened. Thank you!

@telegraf-tiger telegraf-tiger bot closed this Jun 26, 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 plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins waiting for response waiting for response from contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support plugin probing in inputs.chrony
2 participants