-
Notifications
You must be signed in to change notification settings - Fork 100
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
added config read from pve #22
Conversation
Ill fixed all issue in my code, but the python 3.4 is not tied to the feature or my proposal and need to be update in repository. |
Very cool, this sounds like very useful feature. Will add some questions as review comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR, I like the feature a lot.
src/pve_exporter/collector.py
Outdated
'memory': GaugeMetricFamily( | ||
'pve_vm_config_memory', | ||
'Proxmox vm config memory value', | ||
labels=['id', 'node', 'type']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is pve_memory_size_bytes
already, so this metric seems duplicate. Do you have a case where the new metric is better than the existing pve_memory_size_bytes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove it seems like duplicate. I wanted to test it with ballooning memory management if the API cluster/resources does not return current value of ballooning, but don't have time for that ATM. Maybe in the futre will sent another PR for this if i'll test that.
src/pve_exporter/collector.py
Outdated
'onboot': GaugeMetricFamily( | ||
'pve_vm_config_onboot', | ||
'Proxmox vm config onboot value', | ||
labels=['id', 'node', 'type']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prometheus metric naming scheme is something like <prefix>_<name>_<unit>(_<aggregation>)
, e.g. node_cpu_seconds_total
. So I guess my preferred name would be pve_onboot_status
. The vm
prefix is not necessary in my opinion because that one is given by the labels. Looking on other exporters for naming examples I find that node exporter has node_timex_sync_status
. Ceph has metrics ceph_health_status
, ceph_mgr_status
and ceph_mon_quorum_status
. So it looks like status
might be a good unit for boolean flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about this and I make the change as you suggest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only learned about that when they changed a big bunch of metric names in node exporter. There is also a post by Brian Brazil and some docs on the prometheus site about naming.
Released as part of v1.2.0 on pypi. |
Hi, in our case we want to track if virtual is running and also have onboot variable set, so it does boot automatically next time. In this case var is not set if its false, so rule on prometheus side should look for absent(...), because if not set it also missing from pve config files on FS.
So this PR should do it, I know am not skilled programmer. Even if this get you idea for rework its ok.
I wanted not to use diffrent loops for qemu and lxc, but can't get working diffrent query where could be lxc and qemu variables.
Thank you!