metric name update
This commit is contained in:
parent
13b19ced08
commit
3283847b34
3 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Philips Hue statistics exporter for prometheus
|
# Philips Hue exporter for prometheus
|
||||||
|
|
||||||
This exporter exports some variables from Philips Hue Bridge
|
This exporter exports some variables from Philips Hue Bridge
|
||||||
(https://www.philips-hue.com)
|
(https://www.philips-hue.com)
|
||||||
|
|
|
@ -132,7 +132,7 @@ func (collector *Collector) initDescAndType() {
|
||||||
|
|
||||||
switch metric.HueType {
|
switch metric.HueType {
|
||||||
case hue.TypeLight:
|
case hue.TypeLight:
|
||||||
metric.FqName = "hue_light_status"
|
metric.FqName = "hue_light"
|
||||||
help = "status of lights registered at hue bridge"
|
help = "status of lights registered at hue bridge"
|
||||||
metric.PromType = prometheus.GaugeValue
|
metric.PromType = prometheus.GaugeValue
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ func (exporter *Exporter) Collect(metrics []*metric.Metric) (err error) {
|
||||||
|
|
||||||
err = bridge.Login(exporter.Username)
|
err = bridge.Login(exporter.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("[error login] '%v'", err)
|
return fmt.Errorf("[error Login()] '%v'", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, metric := range metrics {
|
for _, metric := range metrics {
|
||||||
|
@ -121,7 +121,7 @@ func collectLights(bridge *hue.Bridge, metric *metric.Metric) (err error) {
|
||||||
func newBridge(ipAddr string) *hue.Bridge {
|
func newBridge(ipAddr string) *hue.Bridge {
|
||||||
bridge, err := hue.NewBridge(ipAddr)
|
bridge, err := hue.NewBridge(ipAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error connecting to Hue bridge at '%v': '%v'\n", ipAddr, err)
|
log.Fatalf("Error connecting to Hue bridge with '%v': '%v'\n", ipAddr, err)
|
||||||
}
|
}
|
||||||
return bridge
|
return bridge
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue