zhangjianweibj / prometheus-libvirt-exporter

prometheus-libvirt-exporter
MIT License
150 stars 58 forks source link

Ability to get metrics about domain block size #38

Open aromeyer opened 2 years ago

aromeyer commented 2 years ago

Add 3 metrics in order to get information about the size of domain block volumes (cover both local and ceph block (rdb) storage):

This work is just a proposal to merge here the work done in this project: https://github.com/shhui/prometheus-libvirt-exporter-1

Example of output (only for the new metrics):

libvirt_domain_block_info_allocation{domain="43f9b475",flavorName="",host="kvm01.lan",instanceId="34ff586e-fe19-416a-b409-de5fbe57af78",instanceName="",projectId="",projectName="",source_ceph_mon_host="",source_file="/data/datastore/43f9b475-0.qcow2",source_rbd="",target_device="vda",userId="",userName=""} 4.75424768e+09

libvirt_domain_block_info_capacity{domain="43f9b475",flavorName="",host="kvm01.lan",instanceId="34ff586e-fe19-416a-b409-de5fbe57af78",instanceName="",projectId="",projectName="",source_ceph_mon_host="",source_file="/data/datastore/43f9b475-0.qcow2",source_rbd="",target_device="vda",userId="",userName=""} 5.1539607552e+10

libvirt_domain_block_info_physical{domain="43f9b475",flavorName="",host="kvm01.lan",instanceId="34ff586e-fe19-416a-b409-de5fbe57af78",instanceName="",projectId="",projectName="",source_ceph_mon_host="",source_file="/data/datastore/43f9b475-0.qcow2",source_rbd="",target_device="vda",userId="",userName=""} 4.753391616e+09

I am a beginner in golang and I don't really now how to deals with dependencies. Sorry if I did something wrong.

rockyluke commented 1 year ago

Hello @zhangjianweibj what do you think about this PR ? 🙏

frittentheke commented 1 year ago

We at @inovex did create a fork from this exporter (https://github.com/inovex/prometheus-libvirt-exporter) an reworked some aspects of the exporter (https://github.com/inovex/prometheus-libvirt-exporter/compare/start_of_fork...v1.4.0).

We even submitted an issue to have prometheus-community adopt the exporter, see https://github.com/prometheus-community/community/issues/50