mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-08 03:26:35 +00:00
Remove fluent-style kingpin
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -35,11 +35,12 @@ import (
|
||||
"github.com/prometheus/common/expfmt"
|
||||
)
|
||||
|
||||
const (
|
||||
FlagTextFileDirectory = "collector.textfile.directory"
|
||||
)
|
||||
|
||||
var (
|
||||
textFileDirectory = kingpin.Flag(
|
||||
"collector.textfile.directory",
|
||||
"Directory to read text files with metrics from.",
|
||||
).Default(getDefaultPath()).String()
|
||||
textFileDirectory *string
|
||||
|
||||
mtimeDesc = prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, "textfile", "mtime_seconds"),
|
||||
@@ -55,6 +56,14 @@ type textFileCollector struct {
|
||||
mtime *float64
|
||||
}
|
||||
|
||||
// newTextFileCollectorFlags ...
|
||||
func newTextFileCollectorFlags(app *kingpin.Application) {
|
||||
textFileDirectory = app.Flag(
|
||||
FlagTextFileDirectory,
|
||||
"Directory to read text files with metrics from.",
|
||||
).Default(getDefaultPath()).String()
|
||||
}
|
||||
|
||||
// newTextFileCollector returns a new Collector exposing metrics read from files
|
||||
// in the given textfile directory.
|
||||
func newTextFileCollector() (Collector, error) {
|
||||
|
||||
Reference in New Issue
Block a user