Change to kingpin for flags

This commit is contained in:
Calle Pettersson
2017-08-12 07:44:59 +01:00
parent 69c83b6a39
commit aee1e4b1fd
5 changed files with 49 additions and 30 deletions

View File

@@ -4,13 +4,13 @@ package collector
import (
"bytes"
"flag"
"log"
"strconv"
"strings"
"github.com/StackExchange/wmi"
"github.com/prometheus/client_golang/prometheus"
"gopkg.in/alecthomas/kingpin.v2"
)
func init() {
@@ -18,7 +18,10 @@ func init() {
}
var (
processWhereClause = flag.String("collector.process.processes-where", "", "WQL 'where' clause to use in WMI metrics query. Limits the response to the processes you specify and reduces the size of the response.")
processWhereClause = kingpin.Flag(
"collector.process.processes-where",
"WQL 'where' clause to use in WMI metrics query. Limits the response to the processes you specify and reduces the size of the response.",
).Default("").String()
)
// A ProcessCollector is a Prometheus collector for WMI Win32_PerfRawData_PerfProc_Process metrics