Skip to content

fix: zero block stats caused by libvirt param ordering#102

Draft
PA733 wants to merge 1 commit intoinovex:masterfrom
MoeDove-LLC:fix/zero-status
Draft

fix: zero block stats caused by libvirt param ordering#102
PA733 wants to merge 1 commit intoinovex:masterfrom
MoeDove-LLC:fix/zero-status

Conversation

@PA733
Copy link

@PA733 PA733 commented Dec 2, 2025

Previously, the CollectDomainBlockDeviceInfo function assumed that libvirt always returned the block device 'name' parameter before specific metrics (like wr.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 irate calculations.

image image image

@frittentheke frittentheke self-assigned this Dec 4, 2025
@frittentheke
Copy link
Collaborator

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 PA733 marked this pull request as draft January 20, 2026 02:41
@frittentheke
Copy link
Collaborator

@PA733 are you still looking into this? Any chance you could give an update to my question #102 (comment) ?

@PA733
Copy link
Author

PA733 commented Feb 4, 2026

@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.

@frittentheke
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants