mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-04 17:46:36 +00:00
Remove fluent-style kingpin
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -15,15 +15,14 @@ import (
|
||||
"github.com/yusufpapurcu/wmi"
|
||||
)
|
||||
|
||||
const (
|
||||
FlagProcessBlacklist = "collector.process.blacklist"
|
||||
FlagProcessWhitelist = "collector.process.whitelist"
|
||||
)
|
||||
|
||||
var (
|
||||
processWhitelist = kingpin.Flag(
|
||||
"collector.process.whitelist",
|
||||
"Regexp of processes to include. Process name must both match whitelist and not match blacklist to be included.",
|
||||
).Default(".*").String()
|
||||
processBlacklist = kingpin.Flag(
|
||||
"collector.process.blacklist",
|
||||
"Regexp of processes to exclude. Process name must both match whitelist and not match blacklist to be included.",
|
||||
).Default("").String()
|
||||
processWhitelist *string
|
||||
processBlacklist *string
|
||||
)
|
||||
|
||||
type processCollector struct {
|
||||
@@ -47,6 +46,18 @@ type processCollector struct {
|
||||
processBlacklistPattern *regexp.Regexp
|
||||
}
|
||||
|
||||
// newProcessCollectorFlags ...
|
||||
func newProcessCollectorFlags(app *kingpin.Application) {
|
||||
processWhitelist = app.Flag(
|
||||
FlagProcessWhitelist,
|
||||
"Regexp of processes to include. Process name must both match whitelist and not match blacklist to be included.",
|
||||
).Default(".*").String()
|
||||
processBlacklist = app.Flag(
|
||||
FlagProcessBlacklist,
|
||||
"Regexp of processes to exclude. Process name must both match whitelist and not match blacklist to be included.",
|
||||
).Default("").String()
|
||||
}
|
||||
|
||||
// NewProcessCollector ...
|
||||
func newProcessCollector() (Collector, error) {
|
||||
const subsystem = "process"
|
||||
|
||||
Reference in New Issue
Block a user