diff --git a/metrics.go b/metrics.go index 3ed80fd..cfd89ee 100644 --- a/metrics.go +++ b/metrics.go @@ -125,6 +125,21 @@ var ( Name: "site_realtime_data_udc4", Help: "Site real time data DC voltage string 4", }) + siteRealtimeDataFACGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "site_realtime_data_fac", + Help: "Site real time data AC frequency", + }) + siteRealtimeDataPACGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "site_realtime_data_pac", + Help: "Site real time data AC power", + }) + siteRealtimeDataTotalEnergyGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Namespace: namespace, + Name: "site_realtime_data_total_energy", + Help: "Site real time data total energy", + }) ) func collectMetricsFromTarget(client *fronius.SymoClient) { @@ -221,6 +236,10 @@ func parseInverterRealtimeData(data *fronius.SymoInverterRealtimeData) { siteRealtimeDataUDCGauge2.Set(data.UDC2.Value) siteRealtimeDataUDCGauge3.Set(data.UDC3.Value) siteRealtimeDataUDCGauge4.Set(data.UDC4.Value) + + siteRealtimeDataFACGauge.Set(data.FAC.Value) + siteRealtimeDataPACGauge.Set(data.PAC.Value) + siteRealtimeDataTotalEnergyGauge.Set(data.TOTAL_ENERGY.Value) } func parseArchiveMetrics(data map[string]fronius.InverterArchive) { diff --git a/pkg/fronius/symo.go b/pkg/fronius/symo.go index 9d3abf0..7b1d4b9 100644 --- a/pkg/fronius/symo.go +++ b/pkg/fronius/symo.go @@ -71,15 +71,26 @@ type ( } } SymoInverterRealtimeData struct { + //currents of strings 1 to 4 IDC1 RealTimeDataPoint `json:"IDC"` IDC2 RealTimeDataPoint `json:"IDC_2"` IDC3 RealTimeDataPoint `json:"IDC_3"` IDC4 RealTimeDataPoint `json:"IDC_4"` + //voltages of strings 1 to 4 UDC1 RealTimeDataPoint `json:"UDC"` UDC2 RealTimeDataPoint `json:"UDC_2"` UDC3 RealTimeDataPoint `json:"UDC_3"` UDC4 RealTimeDataPoint `json:"UDC_4"` + + //AC frequency + FAC RealTimeDataPoint `json:"FAC"` + + //AC power + PAC RealTimeDataPoint `json:"PAC"` + + //total energy + TOTAL_ENERGY RealTimeDataPoint `json:"TOTAL_ENERGY"` } RealTimeDataPoint struct {