fix: zero block stats caused by libvirt param ordering#102
fix: zero block stats caused by libvirt param ordering#102PA733 wants to merge 1 commit intoinovex:masterfrom
Conversation
|
Thanks @PA733 for your PR! Do you mind pointing me to the source code in libvirt or go-libvirt that causes the order to actually be random? |
|
@PA733 are you still looking into this? Any chance you could give an update to my question #102 (comment) ? |
Sorry for the delay — I’ve been busy recently. I’ve done some additional testing, and it looks like this PR doesn’t fully resolve the issue yet. I’ll continue investigating and update the PR once I have a solid fix. |
If you could, please kindly share some code to reproduce the issue. Because any code you send in to fix an issue that I never saw, I cannot review. |
Previously, the
CollectDomainBlockDeviceInfofunction assumed that libvirt always returned the block device 'name' parameter before specific metrics (likewr.bytes) in the parameter list. However, libvirt does not guarantee this order.When metrics appeared before the name, the exporter failed to associate them with the device, resulting in zero values. This caused Prometheus to incorrectly detect a counter reset, leading to massive spikes in
iratecalculations.