diff --git a/main.go b/main.go index 2cc2e1b8f917efcdaf2e541567d188697d8b3dee..1276f336a6478f48b52e4d43cd14fbc6b9f6fd74 100644 --- a/main.go +++ b/main.go @@ -93,47 +93,49 @@ func NewExporter(uri string) *Exporter { prometheus.BuildFQName(namespace, "", "up"), "Is the Nexenta API reachable", nil, - nil), + prometheus.Labels{"host":*apiHost}, + ), scrapeFailures: prometheus.NewCounter(prometheus.CounterOpts{ - Namespace: namespace, - Name: "exporter_scrape_failures_total", - Help: "Number of errors while scraping the Nexenta API", + Namespace: namespace, + Name: "exporter_scrape_failures_total", + Help: "Number of errors while scraping the Nexenta API", + ConstLabels: prometheus.Labels{"host":*apiHost}, }), volumeOnline: prometheus.NewDesc( prometheus.BuildFQName(namespace, "volume", "online"), "Status of volume.", []string{"volume"}, - nil, + prometheus.Labels{"host":*apiHost}, ), jbodStatus: prometheus.NewDesc( prometheus.BuildFQName(namespace, "jbod", "status"), "Status of JBOD.", []string{"jbod"}, - nil, + prometheus.Labels{"host":*apiHost}, ), jbodTemp: prometheus.NewDesc( prometheus.BuildFQName(namespace, "jbod", "temp"), "Temperature of JBOD.", []string{"jbod", "name", "state"}, - nil, + prometheus.Labels{"host":*apiHost}, ), jbodVoltage: prometheus.NewDesc( prometheus.BuildFQName(namespace, "jbod", "voltage"), "Voltage of JBOD.", []string{"jbod", "name", "state"}, - nil, + prometheus.Labels{"host":*apiHost}, ), jbodSlotStatus: prometheus.NewDesc( prometheus.BuildFQName(namespace, "jbod", "slot_status"), "Status of JBOD slot.", []string{"jbod", "slot", "state"}, - nil, + prometheus.Labels{"host":*apiHost}, ), licenseDaysLeft: prometheus.NewDesc( prometheus.BuildFQName(namespace, "license", "days_left"), "License days left.", nil, - nil, + prometheus.Labels{"host":*apiHost}, ), client: &http.Client{ Transport: &http.Transport{