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

@ -41,29 +41,29 @@ type edacCollector struct {
}
func init() {
Factories["edac"] = NewEdacCollector
registerCollector("edac", defaultEnabled, NewEdacCollector)
}
// NewEdacCollector returns a new Collector exposing edac stats.
func NewEdacCollector() (Collector, error) {
return &edacCollector{
ceCount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, edacSubsystem, "correctable_errors_total"),
prometheus.BuildFQName(namespace, edacSubsystem, "correctable_errors_total"),
"Total correctable memory errors.",
[]string{"controller"}, nil,
),
ueCount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, edacSubsystem, "uncorrectable_errors_total"),
prometheus.BuildFQName(namespace, edacSubsystem, "uncorrectable_errors_total"),
"Total uncorrectable memory errors.",
[]string{"controller"}, nil,
),
csRowCECount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, edacSubsystem, "csrow_correctable_errors_total"),
prometheus.BuildFQName(namespace, edacSubsystem, "csrow_correctable_errors_total"),
"Total correctable memory errors for this csrow.",
[]string{"controller", "csrow"}, nil,
),
csRowUECount: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, edacSubsystem, "csrow_uncorrectable_errors_total"),
prometheus.BuildFQName(namespace, edacSubsystem, "csrow_uncorrectable_errors_total"),
"Total uncorrectable memory errors for this csrow.",
[]string{"controller", "csrow"}, nil,
),