2014-02-18 03:35:11 -08:00
|
|
|
// Exporter is a prometheus exporter using multiple Factories to collect and export system metrics.
|
|
|
|
package collector
|
|
|
|
|
2014-06-26 10:20:36 -07:00
|
|
|
const Namespace = "node"
|
2014-02-18 03:35:11 -08:00
|
|
|
|
2014-06-26 10:20:36 -07:00
|
|
|
var Factories = make(map[string]func(Config) (Collector, error))
|
2014-02-18 03:35:11 -08:00
|
|
|
|
|
|
|
// Interface a collector has to implement.
|
|
|
|
type Collector interface {
|
|
|
|
// Get new metrics and expose them via prometheus registry.
|
|
|
|
Update() (n int, err error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
Attributes map[string]string `json:"attributes"`
|
|
|
|
}
|