influxdata / influxdata/telegraf
inputs.libvirt: Expose domain's energy stats from libvirt. Available since 12.4.0
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.8k
- Forks
- 5.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 161
Description
### Use Case
Libvirt 12.4.0 introduced per-domain energy metrics from resctrl filesystem as part of domain stats. Exposing these stats through Telegraf would enable operators to track the cumulative energy consumed by each VM running in their infrastructure. It can be used then to derive granular power consumption, compare efficiency etc
### Expected behavior
When cpu_total is enabled and libvirt 12.4.0 or later reports cpu.energy.monitor.* domain statistics, Telegraf should expose available energy metrics (core_energy in Joules, activity in Farads) and monitor metadata.
libvirt_cpu_energy_monitor_total,domain_name=example-domain count=1u
libvirt_cpu_energy_monitor,domain_name=example-domain,energy_monitor_id=0 name="example-monitor",pkg_count=2u
libvirt_cpu_energy_monitor_pkg,domain_name=example-domain,energy_monitor_id=0,pkg_index=0 activity=1234.5,core_energy=100.25,id=0u
libvirt_cpu_energy_monitor_pkg,domain_name=example-domain,energy_monitor_id=0,pkg_index=1 activity=2345.6,core_energy=200.5,id=1u
### Actual behavior
Telegraf currently ignores all cpu energy metrics from libvirt
### Additional info
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the inputs.libvirt input and locate the existing cpu_total domain-stat handling. Compare the available cpu.energy.monitor.* statistics from libvirt 12.4.0 with the requested total, monitor, and package metric names, then verify that the reported fields and units match the examples when cpu_total is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100