Skip to content

Commit 9791f80

Browse files
author
Dylan Gardner
committed
Collect more power utilizations metrics
1 parent bed4123 commit 9791f80

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

collector/chassis_collector.go

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,34 @@ var (
119119
nil,
120120
),
121121
},
122+
"chassis_power_powersupply_power_efficiency_percentage": {
123+
desc: prometheus.NewDesc(
124+
prometheus.BuildFQName(namespace, ChassisSubsystem, "power_powersupply_power_efficiency_percentage"),
125+
"rated efficiency, as a percentage, of the associated power supply on this chassis",
126+
ChassisPowerSupplyLabelNames,
127+
nil,
128+
),
129+
},
122130
"chassis_power_powersupply_last_power_output_watts": {
123131
desc: prometheus.NewDesc(
124132
prometheus.BuildFQName(namespace, ChassisSubsystem, "power_powersupply_last_power_output_watts"),
125-
"last_power_output_watts of powersupply on this chassis",
133+
"average power output, measured in Watts, of the associated power supply on this chassis",
134+
ChassisPowerSupplyLabelNames,
135+
nil,
136+
),
137+
},
138+
"chassis_power_powersupply_power_input_watts": {
139+
desc: prometheus.NewDesc(
140+
prometheus.BuildFQName(namespace, ChassisSubsystem, "power_powersupply_power_input_watts"),
141+
"measured input power, in Watts, of powersupply on this chassis",
142+
ChassisPowerSupplyLabelNames,
143+
nil,
144+
),
145+
},
146+
"chassis_power_powersupply_power_output_watts": {
147+
desc: prometheus.NewDesc(
148+
prometheus.BuildFQName(namespace, ChassisSubsystem, "power_powersupply_power_output_watts"),
149+
"measured output power, in Watts, of powersupply on this chassis",
126150
ChassisPowerSupplyLabelNames,
127151
nil,
128152
),
@@ -407,8 +431,12 @@ func parseChassisPowerInfoPowerSupply(ch chan<- prometheus.Metric, chassisID str
407431
defer wg.Done()
408432
chassisPowerInfoPowerSupplyName := chassisPowerInfoPowerSupply.Name
409433
chassisPowerInfoPowerSupplyID := chassisPowerInfoPowerSupply.MemberID
434+
chassisPowerInfoPowerSupplyEfficiencyPercent := chassisPowerInfoPowerSupply.EfficiencyPercent
410435
chassisPowerInfoPowerSupplyPowerCapacityWatts := chassisPowerInfoPowerSupply.PowerCapacityWatts
436+
chassisPowerInfoPowerSupplyPowerInputWatts := chassisPowerInfoPowerSupply.PowerInputWatts
437+
chassisPowerInfoPowerSupplyPowerOutputWatts := chassisPowerInfoPowerSupply.PowerOutputWatts
411438
chassisPowerInfoPowerSupplyLastPowerOutputWatts := chassisPowerInfoPowerSupply.LastPowerOutputWatts
439+
412440
chassisPowerInfoPowerSupplyState := chassisPowerInfoPowerSupply.Status.State
413441
chassisPowerInfoPowerSupplyHealth := chassisPowerInfoPowerSupply.Status.Health
414442
chassisPowerSupplyLabelvalues := []string{"power_supply", chassisID, chassisPowerInfoPowerSupplyName, chassisPowerInfoPowerSupplyID}
@@ -418,8 +446,11 @@ func parseChassisPowerInfoPowerSupply(ch chan<- prometheus.Metric, chassisID str
418446
if chassisPowerInfoPowerSupplyHealthValue, ok := parseCommonStatusHealth(chassisPowerInfoPowerSupplyHealth); ok {
419447
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_health"].desc, prometheus.GaugeValue, chassisPowerInfoPowerSupplyHealthValue, chassisPowerSupplyLabelvalues...)
420448
}
449+
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_power_efficiency_percentage"].desc, prometheus.GaugeValue, float64(chassisPowerInfoPowerSupplyEfficiencyPercent), chassisPowerSupplyLabelvalues...)
421450
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_last_power_output_watts"].desc, prometheus.GaugeValue, float64(chassisPowerInfoPowerSupplyLastPowerOutputWatts), chassisPowerSupplyLabelvalues...)
422451
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_power_capacity_watts"].desc, prometheus.GaugeValue, float64(chassisPowerInfoPowerSupplyPowerCapacityWatts), chassisPowerSupplyLabelvalues...)
452+
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_power_input_watts"].desc, prometheus.GaugeValue, float64(chassisPowerInfoPowerSupplyPowerInputWatts), chassisPowerSupplyLabelvalues...)
453+
ch <- prometheus.MustNewConstMetric(chassisMetrics["chassis_power_powersupply_power_output_watts"].desc, prometheus.GaugeValue, float64(chassisPowerInfoPowerSupplyPowerOutputWatts), chassisPowerSupplyLabelvalues...)
423454
}
424455

425456
func parseNetworkAdapter(ch chan<- prometheus.Metric, chassisID string, networkAdapter *redfish.NetworkAdapter, wg *sync.WaitGroup) error {

0 commit comments

Comments
 (0)