Skip to content

Commit dae7003

Browse files
committed
Add a machine_swap_bytes metric
Signed-off-by: Itamar Holder <[email protected]>
1 parent 95a0427 commit dae7003

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

metrics/prometheus_machine.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ func NewPrometheusMachineCollector(i infoProvider, includedMetrics container.Met
111111
return metricValues{{value: float64(machineInfo.MemoryCapacity), timestamp: machineInfo.Timestamp}}
112112
},
113113
},
114+
{
115+
name: "machine_swap_bytes",
116+
help: "Amount of swap memory available on the machine.",
117+
valueType: prometheus.GaugeValue,
118+
getValues: func(machineInfo *info.MachineInfo) metricValues {
119+
return metricValues{{value: float64(machineInfo.SwapCapacity), timestamp: machineInfo.Timestamp}}
120+
},
121+
},
114122
{
115123
name: "machine_dimm_count",
116124
help: "Number of RAM DIMM (all types memory modules) value labeled by dimm type.",

0 commit comments

Comments
 (0)