2014-02-18 03:35:11 -08:00
|
|
|
// Exporter is a prometheus exporter using multiple Factories to collect and export system metrics.
|
|
|
|
package collector
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
)
|
|
|
|
|
2014-06-04 04:12:34 -07:00
|
|
|
var Factories = make(map[string]func(Config, prometheus.Registry) (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"`
|
|
|
|
}
|