Skip to content

Commit

Permalink
Merge pull request #44 from ccremer/fix-inverter-name
Browse files Browse the repository at this point in the history
Fix inverter label in MPPT metrics
  • Loading branch information
ccremer committed Aug 12, 2021
2 parents 4815243 + e87716e commit f1fdf91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions metrics.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"strings"
"sync"
"time"

Expand Down Expand Up @@ -157,6 +158,7 @@ func parsePowerFlowMetrics(data *fronius.SymoData) {
func parseArchiveMetrics(data map[string]fronius.InverterArchive) {
log.WithField("archiveData", data).Debug("Parsing data.")
for key, inverter := range data {
key = strings.TrimPrefix(key, "inverter/")
siteMPPTCurrentDCGaugeVec.WithLabelValues(key, "1").Set(inverter.Data.CurrentDCString1.Values["0"])
siteMPPTCurrentDCGaugeVec.WithLabelValues(key, "2").Set(inverter.Data.CurrentDCString2.Values["0"])
siteMPPTVoltageGaugeVec.WithLabelValues(key, "1").Set(inverter.Data.VoltageDCString1.Values["0"])
Expand Down

0 comments on commit f1fdf91

Please sign in to comment.