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

Adopt prometheus-libvirt-exporter #50

Open
frittentheke opened this issue Sep 13, 2023 · 7 comments
Open

Adopt prometheus-libvirt-exporter #50

frittentheke opened this issue Sep 13, 2023 · 7 comments
Labels
needs sponsor This request needs a Prometheus Team member to sponsor maintenance.

Comments

@frittentheke
Copy link

I'd like to propose / offer moving https://github.com/inovex/prometheus-libvirt-exporter to prometheus-community.

Libvirt is likely the most widely used VM hypervisor on Linux.
Be it to run some VMs on a single server or managed by orchestrators the likes of OpenStack (Nova), Proxmox or others.
There are/were other exporters, namely Tinkoff's which was in turn based on Kumina's. Development of all of them has stalled unfortunately, even though https://github.com/prometheus/prometheus/wiki/Default-port-allocations still links to them and e.g. Debian still creates packages (https://packages.debian.org/sid/prometheus-libvirt-exporter).

Apart from the lack of recent development activity, the most important difference is the used library to communicate with libvirt. While @kumina and @Tinkoff use https://github.com/libvirt/libvirt-go, which is a C-library, the proposed prometheus-libvirt-exporter (https://github.com/inovex/prometheus-libvirt-exporter) uses go-libvirt (https://github.com/digitalocean/go-libvirt) native Golang lib (auto-)created by DigitalOcean. This allows the exporter to be much more portable between libvirt versions and distros. There was even some discussion about refactoring (Tinkoff/libvirt-exporter#25), but those efforts never materialised. Additionally the libvirt-go library is now deprecated and has itself been replaced by https://github.com/libvirt/libvirt-go-module.

At @inovex we have been using the prometheus-libvirt-exporter, initially written by @zhangjianweibj for quite a while for our OpenStack environment. But since June 2021 there have been no more commits or releases. And while the exporter already does have support to extract OpenStack Nova metadata from libvirt domain, some changes that were merged (e.g. exporting OpenStack instance flavorName - inovex/prometheus-libvirt-exporter@28296e3) never made it to a binary release.

There were some forks, the most recent / active likely being https://github.com/Ferlab-Ste-Justine/prometheus-libvirt-exporter/ who started to refactor some things. Unfortunately but there were no efforts to update and maintain the exporter outside of individual installations or to become the new default source for it.

We believe having a common and well maintained libvirt-exporter makes sense and went ahead to clean and modernize the existing code:

  • Use the official Prometheus exporter toolkit and built-in landing page
  • Update all modules to their latest versions
  • Update logging to use go-kit
  • Update to Go 1.21
  • Add CI for build, linting
  • Add Dependabot config
  • Add releases via goreleaser
  • Export arch and machine attributes via info metrics

We also cleaned up the exported metrics, causing breaking changes in https://github.com/inovex/prometheus-libvirt-exporter/releases/tag/v1.4.0):

  • Change the label names to follow best practices and be snake-cased (similar to Ferlab-Ste-Justine)
  • Move all informational labels to dedicated info metrics to avoid an ever growing list of labels, with more domain metadata being exported.
  • Clean up the metric naming (in regards to the subsystems)

All the changes we did are listed here: inovex/prometheus-libvirt-exporter@start_of_fork...v1.4.0

We hope you agree with our reasoning to start yet another fork and that someone from the prometheus-community sponsors this move. Certainly we will continue to contribute to this exporter also under the prometheus-community umbrella.

@lukasmrtvy
Copy link

@frittentheke hi, do You plan to release the docker image anytime soon, or is the project waiting for adoption by the prometheus-community? Thanks

@frittentheke
Copy link
Author

frittentheke commented Oct 13, 2023

@lukasmrtvy check out inovex/prometheus-libvirt-exporter#3

The images are not yet shown in the releases, but it 1.4.1 can be fetched from at ghcr.io/inovex/prometheus-libvirt-exporter:1.4.1

@cervajs
Copy link

cervajs commented Feb 19, 2024

+1 for adoption

@bwplotka
Copy link
Member

Nice, I think it makes sense, do we have maintainers for this exporter on prometheus-community? (:

@SuperQ
Copy link
Contributor

SuperQ commented Feb 19, 2024

Yes, we would need a volunteer from Prometheus Team to sponsor support.

@SuperQ SuperQ added the needs sponsor This request needs a Prometheus Team member to sponsor maintenance. label Feb 19, 2024
@frittentheke
Copy link
Author

frittentheke commented Feb 22, 2024

@SuperQ @bwplotka we just released 1.5.0 of the exporter, adding a few things and cleaning a few more: https://github.com/inovex/prometheus-libvirt-exporter/releases/tag/v1.5.0

And, in case this was misunderstood, we do not intend to throw this over the fence and run. We are actively using this exporter ourselves and will very likely continue to update and maintain it.

But we are just ONE user and we use it in the context of OpenStack (Nova). There are more metrics and features in libvirt that others might like exported and which we cannot foresee. If you look at the recent release, there are now storage pool metrics. A feature which we don't even use ourselves, but that was asked about on the libvirt-user ML,
https://lists.libvirt.org/archives/list/users@lists.libvirt.org/message/7ICKFJHSO5375ZCLF3G4CW5DR3FLCAV6/, a while back.

The intention of making this a prometheus-community "thing" was more to open this up to other contributors and to be honest to also promote this as a good choice for people looking for their libvirt metrics being exported.

@raspbeguy
Copy link

I also think submitting an example of grafana dashboard for this exporter would be nice, especially because this one break compatibility with all older libvirt exporter.

openstack-mirroring pushed a commit to openstack/openstack that referenced this issue Apr 17, 2024
* Update kolla from branch 'master'
  to 253379f699b0dd4c9c26eb0136b1bcabb57e0e82
  - Merge "prometheus: use inovex/prometheus-libvirt-exporter"
  - prometheus: use inovex/prometheus-libvirt-exporter
    
    The Tinkoff/libvirt-exporter is archived. Latest release in December
    2022. The inovex/prometheus-libvirt-exporter is an active fork that will
    most probably become a prometheus community exporter in the future [1].
    
    Unfortunately this exporter is not 100% compatible with Tinkoff exporter
    that we are using currently [2].
    
    [1]: prometheus-community/community#50
    [2]: inovex/prometheus-libvirt-exporter#22
    
    Change-Id: Icc8a3651d601ab45d448c9d252ca6155219d21cf
openstack-mirroring pushed a commit to openstack/kolla that referenced this issue Apr 17, 2024
The Tinkoff/libvirt-exporter is archived. Latest release in December
2022. The inovex/prometheus-libvirt-exporter is an active fork that will
most probably become a prometheus community exporter in the future [1].

Unfortunately this exporter is not 100% compatible with Tinkoff exporter
that we are using currently [2].

[1]: prometheus-community/community#50
[2]: inovex/prometheus-libvirt-exporter#22

Change-Id: Icc8a3651d601ab45d448c9d252ca6155219d21cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs sponsor This request needs a Prometheus Team member to sponsor maintenance.
Projects
None yet
Development

No branches or pull requests

6 participants