func (c *StorageDomainCollector) Describe(ch chan<- *prometheus.Desc) {
	ch <- upDesc
	ch <- masterDesc
	ch <- availableDesc
	ch <- usedDesc
	ch <- committedDesc
}
Describe implements Prometheus Collector interface
package storagedomain
import (
	"github.com/czerwonk/ovirt_api/api"
	"github.com/czerwonk/ovirt_exporter/metric"
	"github.com/prometheus/client_golang/prometheus"
	log "github.com/sirupsen/logrus"
)
const prefix = "ovirt_storage_"
var (
	availableDesc *prometheus.Desc
	usedDesc      *prometheus.Desc
	committedDesc *prometheus.Desc
	masterDesc    *prometheus.Desc
	upDesc        *prometheus.Desc
)
func init() {
	l := []string{"name", "type", "path"}
	availableDesc = prometheus.NewDesc(prefix+"available_bytes", "Available space in bytes", l, nil)
	usedDesc = prometheus.NewDesc(prefix+"used_bytes", "Used space in bytes", l, nil)
	committedDesc = prometheus.NewDesc(prefix+"committed_bytes", "Committed space in bytes", l, nil)
	upDesc = prometheus.NewDesc(prefix+"up", "Status of storage domain", l, nil)
	masterDesc = prometheus.NewDesc(prefix+"master", "Storage domain is master", l, nil)
}
type StorageDomainCollector struct {
	client          *api.Client
	collectDuration prometheus.Observer
}
func NewCollector(client *api.Client, collectDuration prometheus.Observer) prometheus.Collector {
	return &StorageDomainCollector{client: client, collectDuration: collectDuration}
}
func (c *StorageDomainCollector) Collect(ch chan<- prometheus.Metric) {
	timer := prometheus.NewTimer(c.collectDuration)
	defer timer.ObserveDuration()
	s := StorageDomains{}
	err := c.client.GetAndParse("storagedomains", &s)
	if err != nil {
		log.Error(err)
		return
	}
	for _, h := range s.Domains {
		c.collectMetricsForDomain(h, ch)
	}
}