-
Notifications
You must be signed in to change notification settings - Fork 7
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
Does it make sense to add a units attribute to <metric/>? #8
Comments
This would be a valuable addition. |
Every year or two (or more) there is a vhostmd-related query that reminds me the project still exits :-). I agree adding a units attribute is a useful addition, and also agree it would be a backward compatible change. Do you have time/energy/desire to implement that? If not, no problem. I can get to it next week. |
I guess it just does its job well within the defined scope :)
Would be awesome if you could do that. I am implementing host metrics exposure in kubevirt/kubevirt#5502 for kubevirt. For architectural reasons we can not use vhostmd, but it would be great if I can just add |
Sorry for the delay. I finally found time to work on this issue and thought it would be pretty easy, but unfortunately not the case. The problem is, vhostmd may not even know the unit. E.g. consider the TotalPhyMem metric in the upstream configuration https://github.com/vhostmd/vhostmd/blob/master/vhostmd.xml#L80 In this case we know the unit would be MiB since libvirt reports in KiB and we divide by 1024. But the user could overwrite the action with their own action that produces TotalPhyMem in bytes. And custom actions, like many in your fedora example, would produce values with units unknown to vhostmd. We could add a units attribute to the definition, but it could only be optional and without it we'd be in the same boat. That said, I'm pretty rusty with vhostmd so might be overlooking something and am open to suggestions. |
Yes, that would have been my assumption that the person which writes the vhostmd.xml can optionally specify the resulting unit. |
Add an optional 'unit' attribute to the <metrics> element. The value of 'unit' provided in a <metric> definition is opaque to vhostmd and returned as is when reporting the metric value. Fixes: vhostmd#8 Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Perhaps you have a few minutes to take a peek at the above PR? Thanks! BTW, looking at that old code makes my eyes hurt. It is in bad need of modernization, but I'm surprised the project is still alive and has users :-). |
Add an optional 'unit' attribute to the <metrics> element. The value of 'unit' provided in a <metric> definition is opaque to vhostmd and returned as is when reporting the metric value. Fixes: #8 Signed-off-by: Jim Fehlig <jfehlig@suse.com>
I think it would be great if vhostmd reports the units of the values which it report.
I could think about the following, when vhostmd runs with the default vhostmd.conf on fedora:
vm-dump-metrics
does not seem to care about the exact xml format, so should be backwardcompatibel and much clearer. What do you think?The text was updated successfully, but these errors were encountered: