Remove fluent-style kingpin

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2023-04-16 11:45:07 +02:00
parent a105e088b3
commit da6898afc4
15 changed files with 487 additions and 252 deletions

View File

@@ -9,7 +9,11 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
var dfsrEnabledCollectors = kingpin.Flag("collectors.dfsr.sources-enabled", "Comma-seperated list of DFSR Perflib sources to use.").Default("connection,folder,volume").String()
const (
FlagDfsrEnabledCollectors = "collectors.dfsr.sources-enabled"
)
var dfsrEnabledCollectors *string
// DFSRCollector contains the metric and state data of the DFSR collectors.
type DFSRCollector struct {
@@ -82,6 +86,11 @@ func dfsrGetPerfObjectName(collector string) string {
return (prefix + suffix)
}
// newDFSRCollectorFlags is registered
func newDFSRCollectorFlags(app *kingpin.Application) {
dfsrEnabledCollectors = app.Flag(FlagDfsrEnabledCollectors, "Comma-seperated list of DFSR Perflib sources to use.").Default("connection,folder,volume").String()
}
// newDFSRCollector is registered
func newDFSRCollector() (Collector, error) {
log.Info("dfsr collector is in an experimental state! Metrics for this collector have not been tested.")