metric name update

This commit is contained in:
aexel90 2020-12-22 20:09:25 +01:00
parent 13b19ced08
commit 3283847b34
3 changed files with 4 additions and 4 deletions

View file

@ -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)

View file

@ -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
} }

View file

@ -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
} }