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

Make --watch-config aware of addition and removal of .conf files #12389

Closed
protonmarco opened this issue Dec 13, 2022 · 3 comments · Fixed by #15645
Closed

Make --watch-config aware of addition and removal of .conf files #12389

protonmarco opened this issue Dec 13, 2022 · 3 comments · Fixed by #15645
Assignees
Labels
area/agent feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor

Comments

@protonmarco
Copy link

Use Case

This feature would avoid to have to kill -1 telegraf each time a .conf file is added or removed inside the config directory.

Expected behavior

once --watch-config [notify, poll] is set it should be aware of:

  • changes inside .conf files (already accomplished)
  • .conf removals
  • .conf additions

and reload configuration accordingly.

Actual behavior

Currently --watch-config [poll, notify] reloads the configuration only when the content of a .conf file changes.
When a .conf file is added or removed, a manual configuration reload is still needed.

Additional info

No response

@protonmarco protonmarco added the feature request Requests for new plugin and for new features to existing plugins label Dec 13, 2022
@powersj
Copy link
Contributor

powersj commented Dec 13, 2022

Create is covered by #12264 as well.

@gazpachoking
Copy link
Contributor

This would be great. I already get logging messages when config files are added and deleted, seems like it would be a pretty easy step to have trigger a reload.

2023-03-24T16:44:28Z W! Config file deleted
2023-03-24T16:52:16Z I! Config file appeared

@powersj powersj self-assigned this May 29, 2024
powersj added a commit to powersj/telegraf that referenced this issue Jul 19, 2024
This allows for watching for new files in a configuraiton directory.
When a new file is found, Telegraf will reload with that file added to
the list of files to watch. Note this will reload when any file, a
telegraf config or not, is added to the directory.

TODO: notify type poll does not seem to work, only inotify
TODO: test on Windows

fixes: influxdata#12389
fixes: influxdata#12264
powersj added a commit to powersj/telegraf that referenced this issue Jul 23, 2024
This allows for watching for new files in a configuraiton directory.
When a new file is found, Telegraf will reload with that file added to
the list of files to watch. Note this will reload when any file, a
telegraf config or not, is added to the directory.

TODO: test on Windows

fixes: influxdata#12389
fixes: influxdata#12264
@powersj
Copy link
Contributor

powersj commented Jul 23, 2024

@protonmarco,

I have a PR that adds the ability to watch directories for addition and removal of configuration files: #15645 could you download the artifacts in that PR and verify that this resolves your use-case?

Thanks!

@powersj powersj added the waiting for response waiting for response from contributor label Jul 23, 2024
powersj added a commit to powersj/telegraf that referenced this issue Jul 24, 2024
This allows for watching for new files in a configuraiton directory.
When a new file is found, Telegraf will reload with that file added to
the list of files to watch. Note this will reload when any file, a
telegraf config or not, is added to the directory.

TODO: test on Windows

fixes: influxdata#12389
fixes: influxdata#12264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants