mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-11 04:56:35 +00:00
Remove fluent-style kingpin
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -16,15 +16,14 @@ import (
|
||||
"golang.org/x/sys/windows/svc/mgr"
|
||||
)
|
||||
|
||||
const (
|
||||
FlagServiceWhereClause = "collector.service.services-where"
|
||||
FlagServiceUseAPI = "collector.service.use-api"
|
||||
)
|
||||
|
||||
var (
|
||||
serviceWhereClause = kingpin.Flag(
|
||||
"collector.service.services-where",
|
||||
"WQL 'where' clause to use in WMI metrics query. Limits the response to the services you specify and reduces the size of the response.",
|
||||
).Default("").String()
|
||||
useAPI = kingpin.Flag(
|
||||
"collector.service.use-api",
|
||||
"Use API calls to collect service data instead of WMI. Flag 'collector.service.services-where' won't be effective.",
|
||||
).Default("false").Bool()
|
||||
serviceWhereClause *string
|
||||
useAPI *bool
|
||||
)
|
||||
|
||||
// A serviceCollector is a Prometheus collector for WMI Win32_Service metrics
|
||||
@@ -37,6 +36,18 @@ type serviceCollector struct {
|
||||
queryWhereClause string
|
||||
}
|
||||
|
||||
// newServiceCollectorFlags ...
|
||||
func newServiceCollectorFlags(app *kingpin.Application) {
|
||||
serviceWhereClause = app.Flag(
|
||||
FlagServiceWhereClause,
|
||||
"WQL 'where' clause to use in WMI metrics query. Limits the response to the services you specify and reduces the size of the response.",
|
||||
).Default("").String()
|
||||
useAPI = app.Flag(
|
||||
FlagServiceUseAPI,
|
||||
"Use API calls to collect service data instead of WMI. Flag 'collector.service.services-where' won't be effective.",
|
||||
).Default("false").Bool()
|
||||
}
|
||||
|
||||
// newserviceCollector ...
|
||||
func newserviceCollector() (Collector, error) {
|
||||
const subsystem = "service"
|
||||
|
||||
Reference in New Issue
Block a user