Skip to content
Snippets Groups Projects
Commit 578463c9 authored by Jan Grewe's avatar Jan Grewe
Browse files

Rename 'nexenta_volume_online' to 'nexenta_volume_status', add 'state' and...

Rename 'nexenta_volume_online' to 'nexenta_volume_status', add 'state' and 'errors' labels to 'nexenta_volume_status'
parent 09d59a9f
No related branches found
No related tags found
No related merge requests found
...@@ -24,5 +24,5 @@ Metric | Type | Description ...@@ -24,5 +24,5 @@ Metric | Type | Description
`nexenta_jbod_temp` | gauge | Temperature of JBOD (°C) `nexenta_jbod_temp` | gauge | Temperature of JBOD (°C)
`nexenta_jbod_voltage` | gauge | Voltage of JBOD (Volts) `nexenta_jbod_voltage` | gauge | Voltage of JBOD (Volts)
`nexenta_jbod_slot_status` | gauge | Status of JBOD slot (0/1) `nexenta_jbod_slot_status` | gauge | Status of JBOD slot (0/1)
`nexenta_volume_online` | gauge | Is the volume online (0/1) `nexenta_volume_status` | gauge | Is the volume online (0/1)
`nexenta_license_days_left` | gauge | License days left `nexenta_license_days_left` | gauge | License days left
...@@ -78,7 +78,7 @@ type Exporter struct { ...@@ -78,7 +78,7 @@ type Exporter struct {
up *prometheus.Desc up *prometheus.Desc
scrapeFailures prometheus.Counter scrapeFailures prometheus.Counter
volumeOnline *prometheus.Desc volumeStatus *prometheus.Desc
jbodStatus *prometheus.Desc jbodStatus *prometheus.Desc
jbodTemp *prometheus.Desc jbodTemp *prometheus.Desc
jbodVoltage *prometheus.Desc jbodVoltage *prometheus.Desc
...@@ -101,10 +101,10 @@ func NewExporter(uri string) *Exporter { ...@@ -101,10 +101,10 @@ func NewExporter(uri string) *Exporter {
Help: "Number of errors while scraping the Nexenta API", Help: "Number of errors while scraping the Nexenta API",
ConstLabels: prometheus.Labels{"host":*apiHost}, ConstLabels: prometheus.Labels{"host":*apiHost},
}), }),
volumeOnline: prometheus.NewDesc( volumeStatus: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "volume", "online"), prometheus.BuildFQName(namespace, "volume", "status"),
"Status of volume.", "Status of volume.",
[]string{"volume"}, []string{"volume", "state", "errors"},
prometheus.Labels{"host":*apiHost}, prometheus.Labels{"host":*apiHost},
), ),
jbodStatus: prometheus.NewDesc( jbodStatus: prometheus.NewDesc(
...@@ -148,7 +148,7 @@ func NewExporter(uri string) *Exporter { ...@@ -148,7 +148,7 @@ func NewExporter(uri string) *Exporter {
func (e *Exporter) Describe(ch chan<- *prometheus.Desc) { func (e *Exporter) Describe(ch chan<- *prometheus.Desc) {
ch <- e.up ch <- e.up
e.scrapeFailures.Describe(ch) e.scrapeFailures.Describe(ch)
ch <- e.volumeOnline ch <- e.volumeStatus
ch <- e.jbodStatus ch <- e.jbodStatus
ch <- e.jbodTemp ch <- e.jbodTemp
ch <- e.jbodVoltage ch <- e.jbodVoltage
...@@ -233,7 +233,7 @@ func (e *Exporter) getVolumeStatus(ch chan<- prometheus.Metric, volume string) e ...@@ -233,7 +233,7 @@ func (e *Exporter) getVolumeStatus(ch chan<- prometheus.Metric, volume string) e
if volumeStatus.State[0] == "ONLINE" { volumeOnline = 1 } if volumeStatus.State[0] == "ONLINE" { volumeOnline = 1 }
} }
ch <- prometheus.MustNewConstMetric(e.volumeOnline, prometheus.GaugeValue, volumeOnline, volume) ch <- prometheus.MustNewConstMetric(e.volumeStatus, prometheus.GaugeValue, volumeOnline, volume, volumeStatus.State[0], volumeStatus.Errors[0])
return err return err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment