We already support reading from multiple directories though only using globs. Now we can specify them outright.
Example use case is exporting both static info on a RO FS generated during image building and traditional uses of textfiles (e.g. for R/W service metrics files) without scripting a file copy.
* keep flag name for compatibility
* clarify flag help text
* add test case (replicating the glob one)
Signed-off-by: eduarrrd <eduarrrd@users.noreply.github.com>
textFileDirectory=kingpin.Flag("collector.textfile.directory","Directory to read text files with metrics from.").Default("").String()
mtimeDesc=prometheus.NewDesc(
textFileDirectories=kingpin.Flag("collector.textfile.directory","Directory to read text files with metrics from, supports glob matching. (repeatable)").Default("").Strings()
mtimeDesc=prometheus.NewDesc(
"node_textfile_mtime_seconds",
"Unixtime mtime of textfiles successfully read.",
[]string{"file"},
@ -42,7 +42,7 @@ var (
)
typetextFileCollectorstruct{
pathstring
paths[]string
// Only set for testing to get predictable output.