From 1c3f322f7832d6ebbba9dc3a13b398e03e014bcf Mon Sep 17 00:00:00 2001 From: Rens Groothuijsen Date: Tue, 18 Jun 2024 13:51:47 +0200 Subject: [PATCH] docs: mention implicitly watched directories in documentation (#14019) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mention implicitly watched directories in documentation Signed-off-by: Rens Groothuijsen * Add mention of atomic file renaming Co-authored-by: Ayoub Mrini Signed-off-by: Rens Groothuijsen --------- Signed-off-by: Rens Groothuijsen Co-authored-by: Ayoub Mrini Co-authored-by: Björn Rabenstein --- docs/configuration/configuration.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index b83219700a1..5df7dae3c02 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -1608,7 +1608,16 @@ and serves as an interface to plug in custom service discovery mechanisms. It reads a set of files containing a list of zero or more ``s. Changes to all defined files are detected via disk watches -and applied immediately. Files may be provided in YAML or JSON format. Only +and applied immediately. + +While those individual files are watched for changes, +the parent directory is also watched implicitly. This is to handle [atomic +renaming](https://github.com/fsnotify/fsnotify/blob/c1467c02fba575afdb5f4201072ab8403bbf00f4/README.md?plain=1#L128) efficiently and to detect new files that match the configured globs. +This may cause issues if the parent directory contains a large number of other files, +as each of these files will be watched too, even though the events related +to them are not relevant. + +Files may be provided in YAML or JSON format. Only changes resulting in well-formed target groups are applied. Files must contain a list of static configs, using these formats: