telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

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

Open conorevans opened this issue 3 years ago • 13 comments

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.

conorevans avatar Jan 05 '22 02:01 conorevans

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

telegraf-tiger[bot] avatar Jan 05 '22 02:01 telegraf-tiger[bot]

!signed-cla

conorevans avatar Jan 05 '22 02:01 conorevans

@conorevans This PR is still named draft. Is this ready for review?

sjwang90 avatar Apr 11 '22 19:04 sjwang90

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?

conorevans avatar Apr 11 '22 20:04 conorevans

Yeah - go ahead and remove the draft title and I'll mention it to the maintainers to do a review.

sjwang90 avatar Apr 11 '22 23:04 sjwang90

@sjwang90 @Hipska @conorevans Hi all! Any chance to make this PR merged? I'll be glad to help if any help is needed.

iarkhanhelsky avatar Jun 03 '22 18:06 iarkhanhelsky

Hi @iarkhanhelsky thanks to @sjwang90 and @reimda pushing this forward I will look to make their requested changes and update this.

conorevans avatar Jun 08 '22 21:06 conorevans

Does this code also watch for new files added into the dierctory?

shruthikudlur avatar Aug 11 '22 17:08 shruthikudlur

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.

reimda avatar Aug 11 '22 22:08 reimda

@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

sspaink avatar Aug 15 '22 18:08 sspaink

Hi @reimda @sspaink @Hipska this should be good now 🤞

conorevans avatar Aug 15 '22 19:08 conorevans

Closing as this PR has been replaced by: https://github.com/influxdata/telegraf/pull/12127

sspaink avatar Nov 03 '22 21:11 sspaink