Skip to content
This repository has been archived by the owner on Jul 23, 2018. It is now read-only.

Add "cluster" label for hosts, vms and datastores #28

Open
dannyk81 opened this issue Feb 9, 2018 · 10 comments · May be fixed by #36
Open

Add "cluster" label for hosts, vms and datastores #28

dannyk81 opened this issue Feb 9, 2018 · 10 comments · May be fixed by #36

Comments

@dannyk81
Copy link
Contributor

dannyk81 commented Feb 9, 2018

It would be great to add "cluster" label to indicate to which HA cluster the host/vm belongs to.

Same, for datastores that belong to a Datastore cluster.

We manage multiple clusters with the same vCenter, and would like to filter metrics per "PROD" and "STAGING" clusters, for example.

@dannyk81
Copy link
Contributor Author

dannyk81 commented Feb 16, 2018

@rverchere looking at pyvmomi and vsphere api, I believe there is no simple way to add this label.

But, we should be able to create a new set of metrics with this information, for example:

vmware_vm_dc_cluster{vm_name="vm1",dc_name="dc1",cluster_name="cluster1"} 1
vmware_host_dc_cluster{host_name="host1",dc_name="dc1",cluster_name="cluster2"} 1
vmware_datastore_dc_cluster{ds_name="ds1",dc_name="dc1",cluster_name="cluster3"} 1

Taking some inspiration on how to retrieve this data from here: https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/getvmsbycluster.py

Once we have these metrics in place, we can use the PromQL grouping capability to build queries like so:

(sum(vmware_host_cpu_usage) / sum(vmware_host_cpu_max) * 100) * ON (host_name) group_left(cluster_name) vmware_host_cluster{cluster_name="PROD"}

The above would be very valuebale to us, as it will allow us to aggregate metrics based on the relevant clusters, espeically for alerting since Prod and Staging hosts/vms/datastores are not to be treated the same.

/edit: I think it would also make sense to include the datacenter name as well (examples updated above), also needless to say but these should only be collected from vcenter target(s).

@dannyk81
Copy link
Contributor Author

dannyk81 commented Mar 2, 2018

@rverchere sorry for nagging 😄 just wondering if you had a chance to look into this?

@rverchere
Copy link
Owner

rverchere commented Mar 2, 2018 via email

@dannyk81
Copy link
Contributor Author

dannyk81 commented Mar 2, 2018

Hey! enjoy your time off 😄

@jgrumboe
Copy link

jgrumboe commented Mar 7, 2018

+1 DC and cluster would be really helpful.
Also enjoy your time off.

@dannyk81
Copy link
Contributor Author

dannyk81 commented Apr 7, 2018

ping @rverchere 😄

@rverchere
Copy link
Owner

@dannyk81 pong : https://github.com/rverchere/vmware_exporter/blob/master/README.md#unmaintained

Sorry but I started new job with new monitoring tools, so I cannot continue maintain this exporter (yet).

@dannyk81
Copy link
Contributor Author

dannyk81 commented Apr 7, 2018

Best of luck @rverchere!

Hope someone is found to continue this work 🙏

@dannyk81 dannyk81 linked a pull request May 2, 2018 that will close this issue
@dannyk81
Copy link
Contributor Author

dannyk81 commented May 2, 2018

@rverchere I know you're no longer working on this, but perhaps you will consider to include #36

It provides a meta metric with labels that describe the datacenter, cluster and host per VM.

It can be easily used in PromQL to filter other metrics based on these parameters.

@pryorda
Copy link

pryorda commented Jun 29, 2018

This issue was moved to pryorda/vmware_exporter#4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants