-
Notifications
You must be signed in to change notification settings - Fork 200
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
Metrics for only one host or datastore instance are reported #40
Comments
I was expecting problems with people probing multiple standalone ESX's or multiple vCenters due to blocking the twisted event loop, but not enumerating a single vCenter. There are much less threads in the new model so i'd actually exepect less threading issues. And previously it didn't wait for all threads to finish - just the last one it spawned. So again, i'd expect less threading issues. Now it runs the threads in One annoying thing with this new code is that it swallows exceptions which might give us a clue. If it wasn't waiting for the thread to finish the thread would still finish, just out of order. So we need to add exeception handling. Give me a second... |
Can someone seeing the issue try #41? It might need fixing - but its a relatively small change. Should hopefully log exceptions seen in the child threads. |
I think that introduces another race. Do you have a clue about why that helps? Is ThreadPoolExecutor not behaving as documented? |
@Jc2k I'm not entirely sure, this was more of a hunch kind of fix. Can you elaborate about your race concern? why did you want to shutdown the threads before getting vm performance metrics? which also fires threads. |
Working on moving the affected code paths over to PropertyCollectors to avoid nested threads and racing. |
#43 removes all nested threads, its working in my test env but i don't have access to a vCenter env to test on right now. |
I instrumented the HTTP library pyvmomi is using - was worried the snapshot code might trigger API calls as it traverses the snapshot tree. But it looks like all the info is captured in the initial PropertyCollect call. |
@dannyk81 could you see if #43 works for you? As i said - not tested with vCenter, so maybe just poke it with curl first and see if the output looks sane. Incidentally i've incorparated and improved #41 so if it does go wrong we might even know why! :) It's fairly late here so I might not reply for a while. |
@Jc2k testing now. |
summary.uncommitted doesn't always exist. I'm working on seeing why. We could compensate with a simple if, but I'm not sure that is the right path. I should have more info shortly. |
So I think the RCA(or at least one of them) might be that the summary.uncommitted doesn't always exist and would sometimes cause the threads to crash, resulting in incorrect results. I still think we should do all your other fixes including the one I'm pushing to the PR.
Thoughts? |
* Use PropertyCollector to do fast VM stats without threads * Fix race conditions around #40 * Fix summary.uncommitted fetching. * Dockerfile fixes.
Update to v0.3.1 as it should fix your issues @karlism |
## 🔖 v0.3.1 Release * #38: Allow cached requirements and build dependencies - Removed * Property collectors (#43) * Use PropertyCollector to do fast VM stats without threads * Fix race conditions around #40 * Fix summary.uncommitted fetching. * Dockerfile fixes. Precommit-Verified: 308310afc2ea3e4d3b73469b49afc75811db75800d8d183c39c1bad0637d0dc3
@pryorda, I updated to version 0.4.2 today and everything seems to working great. Thank you very much for your help and sorry for a late reply! |
Helllo,
VMware exporter returns metrics only for one host or datastore instance.
Environment:
vmware_exporter.py v0.3.0
Python 3.5.2 (Ubuntu) & Python 3.6.6 (OpenBSD)
I've checked that all permissions are correct on vSphere side and also tried connecting by using administrator account.
Steps to reproduce:
Applying following patch shows that only first host or datastore is processed in for loop:
Output after applying patch:
The text was updated successfully, but these errors were encountered: