Skip to content

Commit

Permalink
Fix inverter label in MPPT metrics
Browse files Browse the repository at this point in the history
To align with existing inverter numbering.
  • Loading branch information
ccremer committed Aug 12, 2021
1 parent 4815243 commit e87716e
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 e87716e

Please sign in to comment.