feat(config): Allow reloading on URL config change#15388
feat(config): Allow reloading on URL config change#15388mstrandboge merged 2 commits intoinfluxdata:masterfrom
Conversation
This introduces a new config-url-watch-interval option, which when set will, at each interval, check the Last-Modified header of the file to determine if telegraf should reload. If the header is not available then the watcher is disabled for the file. fixes: influxdata#8730
srebhan
left a comment
There was a problem hiding this comment.
Looks good to me, but I've once concern about removing the warning if we cannot watch a file...
| } else { | ||
| log.Printf("W! Cannot watch config %s: %s", fConfig, err) |
There was a problem hiding this comment.
Can we keep this warning for local files? I'm not sure if there is a sensible case where you can read the file but not stat it, but if there is, I would like to inform the user that we are actually not watching a file he expects us to watch...
There was a problem hiding this comment.
Yep! I've added a check, let me know if that is what you had in mind.
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
|
How does this new function work? Putting "configURLWatchInterval: 1m " under agent or is this already explained somewhere? |
It's a CLI option |
Summary
This introduces a new config-url-watch-interval option, which when set will, at each interval, check the Last-Modified header of the file to determine if telegraf should reload.
If the header is not available then the watcher is disabled for the file.
Checklist
Related issues
fixes: #8730