telegraf
telegraf copied to clipboard
fix(agent): watch for changes in configuration files in config directories
Signed-off-by: Conor Evans [email protected]
Required for all PRs:
- [ ] Updated associated README.md. [I don't think this is necessary]
- [ ] Wrote appropriate unit tests. [TODO]
- [x] Pull request title or commits are in conventional commit format [when I do tests and stuff I will squash the commits into one that follows this convention.
resolves #9985
The walkfn
is virtually identical to config.LoadDirectory()
- I chose duplication over abstraction, as I think the scope for the latter is limited and undesirable.
Thanks so much for the pull request!
:handshake: :black_nib: 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
!signed-cla
:thumbsup: This pull request doesn't change the Telegraf binary size
:package: Looks like new artifacts were built from this PR.
Expand this list to get them here ! :tiger:
Artifact URLs
@conorevans This PR is still named draft
. Is this ready for review?
Hi @sjwang90 as an external contributor, I marked it as draft to show it needed some early feedback (in case the approach I took was terrible). I left some comments as to the things I though maintainers might like to comment on, but it's remained inactive. I can remove the draft
label if that would make it more obvious that it needed feedback?
Yeah - go ahead and remove the draft title and I'll mention it to the maintainers to do a review.
@sjwang90 @Hipska @conorevans Hi all! Any chance to make this PR merged? I'll be glad to help if any help is needed.
Hi @iarkhanhelsky thanks to @sjwang90 and @reimda pushing this forward I will look to make their requested changes and update this.
Does this code also watch for new files added into the dierctory?
Does this code also watch for new files added into the dierctory?
It only watches the files that were in the directory when telegraf loads its config. You would need to restart or sighup telegraf to watch new files.
@conorevans If you fix the failing tests we can get this merged, thank you for your hard work!
It is failing with: cmd/telegraf/telegraf.go:388:11: cannot use &fConfigs (value of type *[]string) as flag.Value value in argument to flag.Var: *[]string does not implement flag.Value (missing method Set)
Looks like we need to keep the fConfigs to be sliceFlags
and not []strings
Hi @reimda @sspaink @Hipska this should be good now 🤞
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. Downloads for additional architectures and packages are available below.
:relaxed: This pull request doesn't significantly change the Telegraf binary size (less than 1%)
:package: Click here to get additional PR build artifacts
Artifact URLs
Closing as this PR has been replaced by: https://github.com/influxdata/telegraf/pull/12127