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

fix(agent): watch for changes in configuration files in config directories #12127

Merged

Conversation

iarkhanhelsky
Copy link
Contributor

Required for all PRs

resolves #9985

Another iteration on the fix from #10379 by @conorevans.

Extracted config.WalkDirectory to collect a list of config files to load configuration from. Reuse the same list later to schedule automatic reloads for changed files.

…ories

Collect a list of config files to load configuration from. Reuse the same list
later to schedule automatic reloads for changed files.
@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 the fix pr to fix corresponding bug label Oct 31, 2022
@iarkhanhelsky
Copy link
Contributor Author

!signed-cla

@iarkhanhelsky
Copy link
Contributor Author

@reimda @srebhan Could you review this? You had comments on related PR. Thanks!

@iarkhanhelsky
Copy link
Contributor Author

!signed-cla

Copy link
Contributor

@sspaink sspaink 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 for working on this! I've also left some minor suggestions.

Not sure why the bot doesn't think you've signed the CLA I checked manually and I see that you did. Sorry about that. edit: I've manually approved the CLA

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

telegraf-tiger bot commented Nov 4, 2022

@Hipska Hipska 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 Nov 7, 2022
@sspaink sspaink closed this Nov 7, 2022
@sspaink sspaink reopened this Nov 7, 2022
@MyaLongmire MyaLongmire merged commit 9d18c97 into influxdata:master Nov 7, 2022
@iarkhanhelsky iarkhanhelsky deleted the telegraf-watch-config-dir branch November 7, 2022 20:07
powersj added a commit to powersj/telegraf that referenced this pull request Jan 3, 2023
PR influxdata#12127 added the ability to reload on files in configuration
directories. However, this broke any and all reloading. The PR assumed
that the list of config files was initialized and set up, however it is
always empty as-is.

To populate the config files variable, the secret-store PR, influxdata#11232,
added the loadConfiguraiton call. This needs to be run first before
attempting to watch any files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent fix pr to fix corresponding bug 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.

Telegraf --watch-config doesn't support directories
4 participants