prometheus / prometheus/node_exporter
powersupplyclass metrics have missing and non-base units
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.8k
- Forks
- 2.7k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 8
Description
I was researching for a blog post, and noticed some issues with the metrics from the powersupplyclass collector.
Only a few of the metrics have units, e.g. node_power_supply_current_ampere has a unit but many including node_power_supply_current_max are missing units.
There's also some units that appear to be incorrect and/or not base units. My laptop doesn't have the metric so I can't be sure, but the unit on node_power_supply_charge_ampere looks to be wrong as it's actually Ah per the kernel docs (https://www.kernel.org/doc/Documentation/power/power_supply_class.txt) - which should be exposed as columbs (i.e. amp seconds). For node_power_supply_energy_watthour should be using the base unit of joules. The capacity metrics are percentages, so should be converted to ratios.
Several labels of node_power_supply_info seem to be able to change over time, including at least capacity_level, status, charge_type and health so should probably be split out into an enum similar.
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
The powersupplyclass collector is the entry point; compare its exported metrics and values with the kernel power_supply_class documentation. Done means relevant metrics use correct base units or ratios, and changing status-like values are represented as an enum rather than labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100