mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-11-09 17:06:13 -06:00
* feat(xo-server-openmetrics): estimate per-VM power consumption from CPU usage * refactor(xo-server-openmetrics): move hostPowerWatts undefined guard to caller * fix(xo-server-openmetrics): log IPMI power read failure as info
1.8 KiB
1.8 KiB
Exposes XenServer/XCP-ng metrics in OpenMetrics/Prometheus format.
Like all other xo-server plugins, it can be configured directly via the web interface, see the plugin documentation.
This plugin creates an HTTP server that exposes a /metrics endpoint compatible with Prometheus scraping. All metrics are enriched with human-readable labels (pool_name, host_name, vm_name, etc.) for easy filtering and visualization.
Features:
- Real-time metrics from all connected pools
- Host metrics: CPU, memory, network, disk IOPS/throughput/latency
- Host uptime metric (
xcp_host_uptime_seconds) - Host status metric (
xcp_host_status) withpower_stateandenabledlabels, including non-running hosts - VM status metric (
xcp_vm_status) withpower_statelabel, including non-running VMs - VM uptime metric (
xcp_vm_uptime_seconds) for running VMs - VM metrics: CPU, memory, network, disk, runstate
- Host power metric (
xcp_host_power_consumption_watts) read from IPMI, carrying asource="ipmi"label - Estimated per-VM power metric (
xcp_vm_power_consumption_watts, labelestimate="true"): each running guest's share of its host's power, split proportionally to CPU load (cpu_usage × vCPUs); dom0 is excluded and the per-host total is preserved; flaggeddata_complete="false"when a VM'scpu_usageis missing is_control_domainlabel on all VM metrics to distinguish dom0 from user VMstagslabel on host, VM and SR metrics carrying the XO tags of the object (comma-separated, sorted), enabling selective monitoring with regex matchers such as{tags=~"(^|.*,)production(,.*|$)"}- VDI disk size metrics: virtual size and physical usage per VDI (
xcp_vdi_virtual_size_bytes,xcp_vdi_physical_usage_bytes) - Bearer token authentication
- OpenMetrics format with EOF marker