make enabled collectors configurable (based on code from node_exporter)

This commit is contained in:
Martin Lindhe
2016-09-01 16:04:43 +02:00
parent 2af46d9313
commit d8f62e07c2
5 changed files with 206 additions and 131 deletions

View File

@@ -1,5 +1,17 @@
package collector
import "github.com/prometheus/client_golang/prometheus"
// ...
const (
wmiNamespace = "wmi"
Namespace = "wmi"
)
// Factories ...
var Factories = make(map[string]func() (Collector, error))
// Collector is the interface a collector has to implement.
type Collector interface {
// Get new metrics and expose them via prometheus registry.
Collect(ch chan<- prometheus.Metric) (err error)
}