Skip to content
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

feat(agent): Add config check sub-command #15732

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Aug 12, 2024

Summary

This PR adds a telegraf config check sub-command to check if the configuration is valid and can be successfully parsed. All plugins are initialized to validate options but are NOT started or executed. The sub-command will exit with a non-zero error code if an error occurs and with a zero error-code otherwise.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #15726

@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 Aug 12, 2024
@srebhan srebhan added area/configuration area/agent ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Aug 14, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Aug 14, 2024
Copy link
Contributor

@powersj powersj 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 putting this together so quickly, I do have one comment/question

cmd/telegraf/cmd_config.go Outdated Show resolved Hide resolved
@telegraf-tiger
Copy link
Contributor

@srebhan srebhan requested a review from powersj August 16, 2024 09:39
Copy link
Contributor

@powersj powersj 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 taking a look at the flags!

@powersj powersj removed their assignment Aug 16, 2024
@Hipska
Copy link
Contributor

Hipska commented Sep 10, 2024

Just too bad there is no documentation about the cli commands anymore 😢 Now we need to download/install the binary and run the help command before we can read about this feature.

@srebhan
Copy link
Member Author

srebhan commented Sep 11, 2024

@Hipska the issue with the previous documentation was that it was incorrect and a pain to maintain. If you do have a constructive proposal on how to document this with correctness and maintainability in mind, let me know!

@Hipska
Copy link
Contributor

Hipska commented Sep 11, 2024

Something similar as the generation of the plugin README's? Could be just an action in the make commands and a test that informs the contributor that the repo is not in a clean state?

@srebhan
Copy link
Member Author

srebhan commented Sep 11, 2024

Good call. Please open an issue and describe a bit what needs to be done... Thanks!

asaharn pushed a commit to asaharn/telegraf that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent area/configuration feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin 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.

feat: flag to validate config files
4 participants