diff --git a/receiver/vcenterreceiver/internal/mockserver/client_mock.go b/receiver/vcenterreceiver/internal/mockserver/client_mock.go index edfe2484a150..4cddd99be2ab 100644 --- a/receiver/vcenterreceiver/internal/mockserver/client_mock.go +++ b/receiver/vcenterreceiver/internal/mockserver/client_mock.go @@ -192,6 +192,9 @@ func routeRetreiveProperties(t *testing.T, body map[string]any) ([]byte, error) if propSet["pathSet"] == "summary.runtime.host" { return loadResponse("vm-host.xml") } + if propSet["pathSet"] == "resourcePool" { + return loadResponse("vm-resource-pool.xml") + } return loadResponse("vm-properties.xml") case (content == "group-v1034" || content == "group-v1001") && contentType == "Folder": diff --git a/receiver/vcenterreceiver/internal/mockserver/responses/vm-properties.xml b/receiver/vcenterreceiver/internal/mockserver/responses/vm-properties.xml index e2c700b1af9e..9f74918e57eb 100644 --- a/receiver/vcenterreceiver/internal/mockserver/responses/vm-properties.xml +++ b/receiver/vcenterreceiver/internal/mockserver/responses/vm-properties.xml @@ -4,6 +4,10 @@ vm-6004 + + resourcePool + resgroup-9 + config diff --git a/receiver/vcenterreceiver/internal/mockserver/responses/vm-resource-pool.xml b/receiver/vcenterreceiver/internal/mockserver/responses/vm-resource-pool.xml new file mode 100644 index 000000000000..95a3a4edd29e --- /dev/null +++ b/receiver/vcenterreceiver/internal/mockserver/responses/vm-resource-pool.xml @@ -0,0 +1,14 @@ + + + + + + vm-1040 + + resourcePool + host-1002 + + + + + diff --git a/receiver/vcenterreceiver/testdata/metrics/expected.yaml b/receiver/vcenterreceiver/testdata/metrics/expected.yaml index de5f893b3bc7..c03564c372fb 100644 --- a/receiver/vcenterreceiver/testdata/metrics/expected.yaml +++ b/receiver/vcenterreceiver/testdata/metrics/expected.yaml @@ -2636,6 +2636,12 @@ resourceMetrics: - key: vcenter.vm.name value: stringValue: CentOS 7 + - key: vcenter.resource_pool.name + value: + stringValue: Resources + - key: vcenter.resource_pool.inventory_path + value: + stringValue: /Datacenter/host/Cluster/Resources scopeMetrics: - metrics: - description: The amount of CPU used by the VM.