prometheus / prometheus/node_exporter

powersupplyclass metrics have missing and non-base units

Open
#1,817 2 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.