Replace --collectors.enabled with per-collector flags (#640)

* Move NodeCollector into package collector

* Refactor collector enabling

* Update README with new collector enabled flags

* Fix out-of-date inline flag reference syntax

* Use new flags in end-to-end tests

* Add flag to disable all default collectors

* Track if a flag has been set explicitly

* Add --collectors.disable-defaults to README

* Revert disable-defaults flag

* Shorten flags

* Fixup timex collector registration

* Fix end-to-end tests

* Change procfs and sysfs path flags

* Fix review comments
This commit is contained in:
Calle Pettersson 2017-09-28 15:06:26 +02:00 committed by Johannes 'fish' Ziemke
commit 859a825bb8
58 changed files with 410 additions and 406 deletions

View file

@ -66,39 +66,39 @@ var (
}
nfsNetReadsDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "net_reads"),
prometheus.BuildFQName(namespace, "nfs", "net_reads"),
"Number of reads at the network layer.",
[]string{"protocol"},
nil,
)
nfsNetConnectionsDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "net_connections"),
prometheus.BuildFQName(namespace, "nfs", "net_connections"),
"Number of connections at the network layer.",
[]string{"protocol"},
nil,
)
nfsRPCOperationsDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "rpc_operations"),
prometheus.BuildFQName(namespace, "nfs", "rpc_operations"),
"Number of RPCs performed.",
nil,
nil,
)
nfsRPCRetransmissionsDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "rpc_retransmissions"),
prometheus.BuildFQName(namespace, "nfs", "rpc_retransmissions"),
"Number of RPC transmissions performed.",
nil,
nil,
)
nfsRPCAuthenticationRefreshesDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "rpc_authentication_refreshes"),
prometheus.BuildFQName(namespace, "nfs", "rpc_authentication_refreshes"),
"Number of RPC authentication refreshes performed.",
nil,
nil,
)
nfsProceduresDesc = prometheus.NewDesc(
prometheus.BuildFQName(Namespace, "nfs", "procedures"),
prometheus.BuildFQName(namespace, "nfs", "procedures"),
"Number of NFS procedures invoked.",
[]string{"version", "procedure"},
nil,
@ -108,7 +108,7 @@ var (
type nfsCollector struct{}
func init() {
Factories["nfs"] = NewNfsCollector
registerCollector("nfs", defaultDisabled, NewNfsCollector)
}
// NewNfsCollector returns a new Collector exposing NFS statistics.