Skip to content

Commit

Permalink
[vSphere][virtualmachine] Add metrics to virtualmachine metricset (el…
Browse files Browse the repository at this point in the history
…astic#40485)

* Add metrics to virtualmachine

* Lint changes

* Address lint errors

* Update data file

* Address review comments

* Resolve lint issues

* Address lint error

* Update the field definitions

* Update network code and address review comment

* mage update

* mage update

* Update tests

* Update metricbeat/module/vsphere/virtualmachine/virtualmachine.go

Co-authored-by: niraj-elastic <[email protected]>

* Address review comments

* Change event

---------

Co-authored-by: niraj-elastic <[email protected]>
  • Loading branch information
ishleenk17 and niraj-elastic authored Aug 28, 2024
1 parent 56a17e0 commit e1bbe05
Show file tree
Hide file tree
Showing 9 changed files with 421 additions and 138 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Allow metricsets to report their status via control v2 protocol. {pull}40025[40025]
- Remove fallback to the node limit for the `kubernetes.pod.cpu.usage.limit.pct` and `kubernetes.pod.memory.usage.limit.pct` metrics calculation
- Add support for Kibana status metricset in v8 format {pull}40275[40275]
- Add metrics for the vSphere Virtualmachine metricset. {pull}40485[40485]
- Add new metrics for the vSphere Datastore metricset. {pull}40441[40441]
- Update metrics for the vSphere Host metricset. {pull}40429[40429]
- Mark system process metricsets as running if metrics are partially available {pull}40565[40565]
Expand Down
88 changes: 75 additions & 13 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -67430,7 +67430,7 @@ virtualmachine
*`vsphere.virtualmachine.host.id`*::
+
--
Host id
Host id.


type: keyword
Expand All @@ -67440,7 +67440,7 @@ type: keyword
*`vsphere.virtualmachine.host.hostname`*::
+
--
Host name of the host
Hostname of the host.


type: keyword
Expand All @@ -67450,7 +67450,7 @@ type: keyword
*`vsphere.virtualmachine.name`*::
+
--
Virtual Machine name
Virtual Machine name.


type: keyword
Expand All @@ -67460,7 +67460,7 @@ type: keyword
*`vsphere.virtualmachine.os`*::
+
--
Virtual Machine Operating System name
Virtual Machine Operating System name.


type: keyword
Expand All @@ -67470,7 +67470,7 @@ type: keyword
*`vsphere.virtualmachine.cpu.used.mhz`*::
+
--
Used CPU in Mhz
Used CPU in Mhz.


type: long
Expand All @@ -67480,7 +67480,7 @@ type: long
*`vsphere.virtualmachine.cpu.total.mhz`*::
+
--
Total CPU in Mhz
Total CPU in Mhz.


type: long
Expand All @@ -67490,7 +67490,7 @@ type: long
*`vsphere.virtualmachine.cpu.free.mhz`*::
+
--
Available CPU in Mhz
Available CPU in Mhz.


type: long
Expand All @@ -67500,7 +67500,7 @@ type: long
*`vsphere.virtualmachine.memory.used.guest.bytes`*::
+
--
Used Memory of Guest in bytes
Used Memory of Guest in bytes.


type: long
Expand All @@ -67512,7 +67512,7 @@ format: bytes
*`vsphere.virtualmachine.memory.used.host.bytes`*::
+
--
Used Memory of Host in bytes
Used Memory of Host in bytes.


type: long
Expand All @@ -67524,7 +67524,7 @@ format: bytes
*`vsphere.virtualmachine.memory.total.guest.bytes`*::
+
--
Total Memory of Guest in bytes
Total Memory of Guest in bytes.


type: long
Expand All @@ -67536,7 +67536,7 @@ format: bytes
*`vsphere.virtualmachine.memory.free.guest.bytes`*::
+
--
Free Memory of Guest in bytes
Free Memory of Guest in bytes.


type: long
Expand All @@ -67548,7 +67548,7 @@ format: bytes
*`vsphere.virtualmachine.custom_fields`*::
+
--
Custom fields
Custom fields.


type: object
Expand All @@ -67558,13 +67558,75 @@ type: object
*`vsphere.virtualmachine.network_names`*::
+
--
Network names
Network names.


type: keyword

--


*`vsphere.virtualmachine.datastore.names`*::
+
--
Names of the datastore associated to this virtualmachine.


type: keyword

--

*`vsphere.virtualmachine.datastore.count`*::
+
--
Number of datastores associated to this virtualmachine.


type: long

--


*`vsphere.virtualmachine.network.names`*::
+
--
Names of the networks associated to this virtualmachine.


type: keyword

--

*`vsphere.virtualmachine.network.count`*::
+
--
Number of networks associated to this virtualmachine.


type: long

--

*`vsphere.virtualmachine.status`*::
+
--
Overall health and status of a virtual machine.


type: keyword

--

*`vsphere.virtualmachine.uptime`*::
+
--
The uptime of the VM in seconds.


type: long

--

[[exported-fields-windows]]
== Windows fields

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/vsphere/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 49 additions & 26 deletions metricbeat/module/vsphere/virtualmachine/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"@timestamp": "2024-08-12T04:51:25.851Z",
"event": {
"dataset": "vsphere.virtualmachine",
"duration": 115000,
Expand All @@ -15,35 +15,58 @@
},
"vsphere": {
"virtualmachine": {
"cpu": {
"used": {
"mhz": 0
}
"network.names": [
"PROD_VCF"
],
"os": "Microsoft Windows 10 (64-bit)",
"datastore": {
"count": 1
},
"host.hostname": "localhost.localdomain",
"host.id": "ha-host",
"memory": {
"free": {
"guest": {
"bytes": 33554432
}
"used": {
"guest": {
"bytes": 0
},
"total": {
"guest": {
"bytes": 33554432
}
},
"used": {
"guest": {
"bytes": 0
},
"host": {
"bytes": 0
}
"host": {
"bytes": 0
}
},
"total": {
"guest": {
"bytes": 4294967296
}
},
"free": {
"guest": {
"bytes": 4294967296
}
}
},
"network": {
"count": 1
},
"host.hostname": "phx-w1c1",
"name": "phx-14",
"cpu": {
"free": {
"mhz": 0
},
"used": {
"mhz": 0
},
"total": {
"mhz": 0
}
},
"name": "ha-host_VM0",
"os": "otherGuest"
"uptime": 0,
"status": "green",
"network_names": [
"PROD_VCF"
],
"datastore.names": [
"VxRailtec-Virtual-SAN-Datastore-247df-bc1d-5aad2"
],
"host.id": "host-20"
}
}
}
}
58 changes: 45 additions & 13 deletions metricbeat/module/vsphere/virtualmachine/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,89 @@
- name: host.id
type: keyword
description: >
Host id
Host id.
- name: host.hostname
type: keyword
description: >
Host name of the host
Hostname of the host.
- name: name
type: keyword
description: >
Virtual Machine name
Virtual Machine name.
- name: os
type: keyword
description: >
Virtual Machine Operating System name
Virtual Machine Operating System name.
- name: cpu.used.mhz
type: long
description: >
Used CPU in Mhz
Used CPU in Mhz.
- name: cpu.total.mhz
type: long
description: >
Total CPU in Mhz
Total CPU in Mhz.
- name: cpu.free.mhz
type: long
description: >
Available CPU in Mhz
Available CPU in Mhz.
- name: memory.used.guest.bytes
type: long
description: >
Used Memory of Guest in bytes
Used Memory of Guest in bytes.
format: bytes
- name: memory.used.host.bytes
type: long
description: >
Used Memory of Host in bytes
Used Memory of Host in bytes.
format: bytes
- name: memory.total.guest.bytes
type: long
description: >
Total Memory of Guest in bytes
Total Memory of Guest in bytes.
format: bytes
- name: memory.free.guest.bytes
type: long
description: >
Free Memory of Guest in bytes
Free Memory of Guest in bytes.
format: bytes
- name: custom_fields
type: object
object_type: keyword
description: >
Custom fields
Custom fields.
- name: network_names
type: keyword
description: >
Network names
Network names.
- name: datastore
type: group
fields:
- name: names
type: keyword
description: >
Names of the datastore associated to this virtualmachine.
- name: count
type: long
description: >
Number of datastores associated to this virtualmachine.
- name: network
type: group
fields:
- name: names
type: keyword
description: >
Names of the networks associated to this virtualmachine.
- name: count
type: long
description: >
Number of networks associated to this virtualmachine.
- name: status
type: keyword
description: >
Overall health and status of a virtual machine.
- name: uptime
type: long
description: >
The uptime of the VM in seconds.
Loading

0 comments on commit e1bbe05

Please sign in to comment.