utils: share the include/exclude regexp flag handling (#2737)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-16 00:07:30 +02:00
committed by GitHub
parent 34738679a1
commit 81ce8ef79d
18 changed files with 422 additions and 224 deletions
+4
View File
@@ -148,6 +148,10 @@ exercised a live Windows role.
YAML key is the collector name and a `docs/collector.<name>.md`;
`TestRegistrations` checks that they agree. The configuration file schema in
`internal/config` only checks keys: the flags parse and validate the values.
Register include/exclude expression flags with `utils.RegexpFlag`, which
anchors the expression, stores the compiled `*regexp.Regexp` in the config
and names the flag in parse errors; use `utils.IsMatchAll`/`IsMatchNone` to
detect unfiltered defaults.
- For textfiles, keep HELP/type metadata consistent across files and preserve
unrelated valid series when reporting duplicates or parse failures. Publish
producer output by replacing a temporary file in the same directory. File