-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[receiver/vcenter] Integration test emits duplicate resources #25831
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for receiver/vcenter: @djaglowski @schmikei. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
It is my understanding that it is very uncommon to have 2 resource pools named the same from an operations standpoint... I can look into if this is actually limited in vCenter though. The simulator that govmomi is providing is the source of this issue, but I'll try and do some exploration on what the best way to safeguard against this would be if its the receiver's responsibility to add the InventoryPath as an attribute or more internal object references to safeguard against this. Snippet from simulator: https://github.com/vmware/govmomi/blob/main/simulator/esx/resource_pool.go |
For clarity: You can have 2 resource pools with the same name, so long as each has a different parent. Parents being one of the following: A host that is not in a cluster, a DRS enabled cluster, or another resource pool. So, you can have:
In the example above, you have 2 resource pools named "Awesome", one under each parent. This makes them unique enough for vCenter, due to the backing IDs. In the original post we have different hosts: |
Will this account for the three possible scenarios mentioned by @Dylan-M?
|
@djaglowski It should. The example from the OP is with hosts, but the other 2 options should also have an inventory path. In the event they don't, there is also a unique object ID that can be gathered via another API call. @schmikei should be able to find out from the documentation. I can continue to assist him in looking into it as well. |
Actually, looking at it again, the sample paths provided from the tests also definitively include the cluster (DC0). vCenter uses the following tree structure, within which the resource pools can appear in the 3 places I mentioned:
|
The integration test emits two identical resource metrics https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/vcenterreceiver/testdata/integration/expected.yaml#L602-L657.
The test client returns two
ResourcePool
objects with the following inventory paths in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/vcenterreceiver/scraper.go#L217:The resource attribute
vcenter.resource_pool.name
is set to the last part of the inventory paths:Resources
.It's unclear if this is just an integration test or if the same is happening in the real world.
If it's not just an integration test, we need to either adjust the resource attributes to be distinct or introduce some deduplication logic
The text was updated successfully, but these errors were encountered: