CPU Total/Free Virtual Machine with vSphere Module [Metricbeat 7.15.2]

Hi, everyone

I have configured vSphere module in Metricbeat 7.15.2 in order to get metrics from my VMware hosts and VMs.

Metricbeat send all VM memory metrics, here you are:

vsphere.virtualmachine.memory.free.guest.bytes: 7.9GB
vsphere.virtualmachine.memory.total.guest.bytes: 8GB
vsphere.virtualmachine.memory.used.guest.bytes: 81MB
vsphere.virtualmachine.memory.used.host.bytes: 1.6GB

However, regarding VM cpu metrics, Metricbeat not send all, here you are:

vsphere.virtualmachine.cpu.used.mhz: 540

Is it possible to get more cpu VM metrics with vSphere Module ?

Thanks in advance :smiley: ,



It all depends on what the VSphere GoLang sdk can pull.

Here is the list of stats that can be exposed via the SDK, some of which are already captured.

	OverallCpuUsage              int32               `xml:"overallCpuUsage,omitempty"`
	OverallCpuDemand             int32               `xml:"overallCpuDemand,omitempty"`
	GuestMemoryUsage             int32               `xml:"guestMemoryUsage,omitempty"`
	HostMemoryUsage              int32               `xml:"hostMemoryUsage,omitempty"`
	GuestHeartbeatStatus         ManagedEntityStatus `xml:"guestHeartbeatStatus"`
	DistributedCpuEntitlement    int32               `xml:"distributedCpuEntitlement,omitempty"`
	DistributedMemoryEntitlement int32               `xml:"distributedMemoryEntitlement,omitempty"`
	StaticCpuEntitlement         int32               `xml:"staticCpuEntitlement,omitempty"`
	StaticMemoryEntitlement      int32               `xml:"staticMemoryEntitlement,omitempty"`
	PrivateMemory                int32               `xml:"privateMemory,omitempty"`
	SharedMemory                 int32               `xml:"sharedMemory,omitempty"`
	SwappedMemory                int32               `xml:"swappedMemory,omitempty"`
	BalloonedMemory              int32               `xml:"balloonedMemory,omitempty"`
	ConsumedOverheadMemory       int32               `xml:"consumedOverheadMemory,omitempty"`
	FtLogBandwidth               int32               `xml:"ftLogBandwidth,omitempty"`
	FtSecondaryLatency           int32               `xml:"ftSecondaryLatency,omitempty"`
	FtLatencyStatus              ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"`
	CompressedMemory             int64               `xml:"compressedMemory,omitempty"`
	UptimeSeconds                int32               `xml:"uptimeSeconds,omitempty"`
	SsdSwappedMemory             int64               `xml:"ssdSwappedMemory,omitempty"`
1 Like


Thank you :slight_smile:


Did u have items on that list u think should be added to the documents? I can make a PR to add them?

1 Like


I have found out that vsphere.virtualmachine.cpu.total.mhz and vsphere.virtualmachine.cpu.free.mhz appears when it is set cpuReservation in the virtual machine.