Skip to content

Export CPU consumption of vhost-net (VHOST) threads for domains #106

@insatomcat

Description

@insatomcat

Hi,

First of all, thank you for maintaining the libvirt Prometheus exporter — it’s been very useful.

I’d like to ask whether you would consider exporting the CPU consumption of the vhost-net (VHOST) threads associated with domains when using virtio networking with vhost enabled.

Currently, the exporter exposes vCPU metrics, but the CPU usage of vhost threads is not included, since these threads are separate from the vCPU threads. In setups with high network throughput, this can represent a significant amount of CPU time.

As a result, we observe a noticeable gap between the total CPU consumption of the QEMU process, and the sum of the CPU consumption of the associated vCPUs

That gap can largely be explained by vhost-net threads, but today it’s invisible from the exported metrics, which makes CPU attribution and capacity analysis harder.

For context, vhost threads are per-domain (or per-queue) kernel/user-space threads created by QEMU/libvirt to accelerate virtio-net I/O, and their CPU usage can be non-trivial in network-heavy workloads.

I have a custom exporter written in Python that collects exactly this information (CPU usage of vhost threads per domain), and I’d be happy to share the code or explain the approach if that’s useful.

However, since the libvirt exporter is written in Go and I don’t have Go experience, I unfortunately can’t offer help to port or implement this myself.

Would you be open to considering this as a feature, or discussing possible approaches that would fit well with the exporter’s design?

Thanks again for your work, and happy to provide more details if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions