Skip to content

Commit

Permalink
add more realtime data metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
chrikoch committed Sep 1, 2024
1 parent e7697e6 commit 4e01d6b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
19 changes: 19 additions & 0 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 11 additions & 0 deletions pkg/fronius/symo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4e01d6b

Please sign in to comment.