From 3283847b3477f89fbd21e69067c45240f944edf0 Mon Sep 17 00:00:00 2001 From: aexel90 Date: Tue, 22 Dec 2020 20:09:25 +0100 Subject: [PATCH] metric name update --- README.md | 2 +- collector/collector.go | 2 +- hue/hue.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc0279c..7321359 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Philips Hue statistics exporter for prometheus +# Philips Hue exporter for prometheus This exporter exports some variables from Philips Hue Bridge (https://www.philips-hue.com) diff --git a/collector/collector.go b/collector/collector.go index 12129f2..af20c06 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -132,7 +132,7 @@ func (collector *Collector) initDescAndType() { switch metric.HueType { case hue.TypeLight: - metric.FqName = "hue_light_status" + metric.FqName = "hue_light" help = "status of lights registered at hue bridge" metric.PromType = prometheus.GaugeValue } diff --git a/hue/hue.go b/hue/hue.go index 4d2196e..7e6bd6d 100644 --- a/hue/hue.go +++ b/hue/hue.go @@ -50,7 +50,7 @@ func (exporter *Exporter) Collect(metrics []*metric.Metric) (err error) { err = bridge.Login(exporter.Username) if err != nil { - return fmt.Errorf("[error login] '%v'", err) + return fmt.Errorf("[error Login()] '%v'", err) } for _, metric := range metrics { @@ -121,7 +121,7 @@ func collectLights(bridge *hue.Bridge, metric *metric.Metric) (err error) { func newBridge(ipAddr string) *hue.Bridge { bridge, err := hue.NewBridge(ipAddr) 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 }