Skip to content
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

gettting metrics from ALL guest instead of the selected instance #204

Open
tibz7 opened this issue Nov 30, 2023 · 7 comments
Open

gettting metrics from ALL guest instead of the selected instance #204

tibz7 opened this issue Nov 30, 2023 · 7 comments

Comments

@tibz7
Copy link

tibz7 commented Nov 30, 2023

I'm having the exporter installed on prometheus host.
I using the prometheus config provided in the doc. I can collect the metrics and render them on the dashboard provided as a link.
In the target I put the IP of ONE proxmox host I want to get the metrics from ( 1 out of 24)
But for some magic reason, I'm getting ALL guests metrics, including the ones that are NOT on that proxmox host!
And filtering does not work of course

@znerol
Copy link
Member

znerol commented Nov 30, 2023

Thanks for the report.

What you are observing is the intended behavior. Prometheus PVE exporter collects metrics by scraping resources via the PVE cluster API.

@tibz7
Copy link
Author

tibz7 commented Dec 1, 2023

Ok thank you!
So it is not possible to the guest by their host?

@znerol
Copy link
Member

znerol commented Dec 1, 2023

The node label is on the pve_guest_info metric. In order to make that available on any other metric, it is necessary to join it to pve_guest_info. E.g.:

pve_up * on(id) group_left(node) pve_guest_info

More examples in #54 and detailed explanation of joins in the robust perception blog.

@tibz7
Copy link
Author

tibz7 commented Dec 4, 2023

So the solution was for me to make this

pve_cpu_usage_ratio /pve_cpu_usage_limit and on(id) pve_node_info{name="HOST"}

@tibz7
Copy link
Author

tibz7 commented Dec 4, 2023

by the way I did not find a way to get the cpu usage ratio for the whole cluster... I tried to sum all the pve_cpu_usage_ratio but that does not really work in the gauge, it gives a gigantic percentage

@spearcrow
Copy link
Contributor

by the way I did not find a way to get the cpu usage ratio for the whole cluster... I tried to sum all the pve_cpu_usage_ratio but that does not really work in the gauge, it gives a gigantic percentage

For whole cluster, maybe you can try to using this

avg(pve_cpu_usage_ratio * on (id) group_left (name) pve_node_info)

@tibz7
Copy link
Author

tibz7 commented Dec 30, 2023 via email

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

No branches or pull requests

3 participants